Skip to content

Commit b9c50b7

Browse files
committed
Remove end caps of cone/cylinder curve
small cleanup for spheres
1 parent 2adf0a3 commit b9c50b7

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

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() if 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
}

0 commit comments

Comments
 (0)