RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.02k stars 186 forks source link

Curve (cylinder) rendering bug #600

Open stukowski opened 2 months ago

stukowski commented 2 months ago

We observe a cylinder rendering issue in OSPRay 3.2.0, which seems to occur whenever the length of the cylinder exceeds a certain threshold.

This is an animation showing a cylinder that extends from (0,0,0) to (x,0,0) with x varying from 0 to 30,000. cylinder_rendering_bug

The issue occurs for any cylinder radius, cylinder axis, camera direction, and projection type: cylinder_rendering_bug_thin cylinder_rendering_bug_perspective

The cylinder is rendered using the curve geometry type:

geometry = ospray::cpp::Geometry("curve");
geometry.setParam("type", OSP_DISJOINT);
geometry.setParam("basis", OSP_LINEAR);
geometry.setParam("vertex.position_radius", ...); // Two vertices (vec4f)
geometry.setParam("index", ...);  // uint32 indices[1] = {0}
geometry.commit();

We have noticed this problem only now, because in our application (OVITO), scenes are typically smaller than 10,000 length units.

johguenther commented 1 month ago

Related to https://github.com/RenderKit/ospray/issues/274, but now OSPRay does not use its own intersection computation anymore but defers to Embree's curves: needs to be fixed there (I'll look into that).