Skip to content

Commit e2cc1a6

Browse files
committed
Remove end caps of cone/cylinder curve
small cleanup for spheres
1 parent d1ff7e0 commit e2cc1a6

7 files changed

Lines changed: 13 additions & 5 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Version History
2424
- Find geometry lights after first empty instance
2525
- Segfault when `numPrimitives()` is called before `commit()`
2626
- Initialization of OpenGL on OSX
27+
- `OSP_DISJOINT` curves had disks at the end of the first and last
28+
cone/cylinder
2729

2830
### Changes in v3.2.0:
2931

modules/cpu/geometry/Curves.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ void Curves::createEmbreeGeometry()
189189
setEmbreeGeometryBuffer(
190190
embreeGeometry, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, texcoordData, 1);
191191
}
192+
capData.clear();
193+
if (curveType == OSP_DISJOINT) {
194+
// disable caps to get always open cones/cylinders
195+
capData.resize(numPrimitives(), RTC_CURVE_FLAG_NEIGHBOR_LEFT | RTC_CURVE_FLAG_NEIGHBOR_RIGHT);
196+
setEmbreeGeometryBuffer(embreeGeometry, RTC_BUFFER_TYPE_FLAGS, capData);
197+
}
192198

193199
rtcCommitGeometry(embreeGeometry);
194200
}

modules/cpu/geometry/Curves.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct OSPRAY_SDK_INTERFACE Curves
2828
Ref<const DataT<vec4f>> tangentData;
2929
Ref<const DataT<vec4f>> colorData;
3030
Ref<const DataT<vec2f>> texcoordData;
31+
std::vector<uint8_t> capData;
3132

3233
RTCGeometryType embreeCurveType{(RTCGeometryType)-1};
3334

modules/cpu/geometry/SpheresShared.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ struct Spheres
1515
Data1D sphere;
1616
Data1D texcoord;
1717
Data1D normalData;
18-
float global_radius;
1918
OSPSphereType sphereType;
2019

2120
#ifdef __cplusplus
22-
Spheres() : global_radius(.01f)
21+
Spheres()
2322
{
2423
super.type = GEOMETRY_TYPE_SPHERES;
2524
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1fe1248c860675a236275d280f209d69
1+
d808e1c19a981c996076630d6d84987c
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e7023c32188855a556bf2b140a4790e8
1+
574c40e72117c607c8ce503f0ff9dd92
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
701ee56ee7ea7ec7210d44a35684e484
1+
48bb96453c5151afba3ccf877986704a

0 commit comments

Comments
 (0)