Orthographic camera with B-spline curves


We’ve been adding support for B-spline curves to our renderer and noticed some weird behaviors when using an orthographic camera.

Here’s a comparison with Embree:

From the different setups we’ve tried, it seems that the built-in intersection program is “faulty” whenever a curved segment is orthogonal to the ray direction. With an orthographic camera, this becomes much more visible.

I was able to re-create this behavior in the provided SDK example (optixCurves) by changing the ray generation program:

diff --git a/SDK/optixCurves/optixCurves.cu b/SDK/optixCurves/optixCurves.cu
index e157b5d..5dea427 100644
--- a/SDK/optixCurves/optixCurves.cu
+++ b/SDK/optixCurves/optixCurves.cu
@@ -57,8 +57,14 @@ static __forceinline__ __device__ void computeRay( uint3 idx, uint3 dim, float3&
             static_cast<float>( idx.y ) / static_cast<float>( dim.y )
             ) - 1.0f;

-    origin    = params.cam_eye;
-    direction = normalize( d.x * U + d.y * V + W );
+    origin =
+        2.f * make_float3(static_cast<float>(idx.x) / static_cast<float>(dim.x),
+                          static_cast<float>(idx.y) / static_cast<float>(dim.y),
+                          0) - 1.f;
+    origin.z = params.cam_eye.z;
+    direction = make_float3(0.f, 0.f, -1.f);
+    //direction = normalize(make_float3(0.001f, 0.f, -1.f));

The commented line, where the ray direction is changed, slightly offsets the viewing direction such that the curve is no longer contained in a orthogonal plane to the viewing direction. Below is a comparison with the patch above:

  • left: orthogonal viewing direction (patch as-is)
  • right: slighlty offset angle (un-commented patch)

We’ve noticed this with B-spline curves, but we did not try other curve types. Also, this at least affects Optix 7.4 and 7.5.

Is this a known issue?

Thanks for the report.

Could you please also provide the rest of the system configuration?

OS version, installed GPU(s), VRAM amount, display driver version, OptiX (major.minor.micro) version, CUDA toolkit version (major.minor) used to generate the input PTX, host compiler version.

Of course, here you go:

OS: Ubuntu 20.04.1 (5.15.0-56)
GPU: RTX 4080 16GB (v525.60.11)
OptiX: 7.4.0
Host compiler: clang++ (12.0.0)
CUDA: 11.8 (nvcc 11.8.89)

This is at least one machine where it fails. my colleagues have different setups (different GPUs and CUDA versions for sure). I can track that down too, if it helps.

Thanks. I could reproduce it and filed a bug report for investigation.

Sorry to bump this thread.
But, have you been able to narrow this bug down to a specific OptiX version, driver version, etc?

Knowing this information would allow us to narrow a warning message to our users.

The issue has been fixed internally on Feb 8th and if I interpret the release branch change numbers correctly, the fix should have made it into the 531.18 drivers for Windows and 530.30.02 drivers for Linux.

This should have been always broken, so there is no older driver range to recommend.

Please try newly released R530 drivers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.