I’m building a GPU-accelerated sunlight analysis engine. My setup: RTX 4090, CUDA 13.3, Driver 610.62, Win11, VS2022, OptiX SDK 7.7 & 9.1 tested.
Problem: GPU occlusion rays exhibit opposite incorrect behavior in different OptiX versions:
- 9.1: ALL rays report HIT (false positive — everything appears occluded)
- 7.7: ALL rays report MISS (false negative — nothing occluded)
What works: A standalone test with a single hand-coded triangle (20x20m at z=1) produces correct hit/miss in BOTH versions.
What doesn’t work: Real CAD geometry extracted via Autodesk SubDMesh.GetObjectMesh — 84 triangles (building walls, roofs, floors). The BVH is built with OPTIX_GEOMETRY_FLAG_DISABLE_TRIANGLE_FACE_CULLING, single GAS + IAS with identity transform.
What I’ve tried (all failed):
-
| # | Fix Attempted | 9.1 Result | 7.7 Result |
|—|---------------|-----------|-----------|
| 1 | Face culling: `FLAG_NONE` (default) | All-hit | All-miss |
| 2 | Face culling: `FLAG_DISABLE_TRIANGLE_FACE_CULLING` | All-hit | All-miss |
| 3 | t_min: 0.001 → 0.1 | N/A (tested in 7.7 only) | All-miss |
| 4 | Payload values: 3 → 2 | All-hit | All-miss |
| 5 | BVH compaction: enabled → disabled | All-hit | All-miss |
| 6 | Winding swap (indices 0,2,1) + FLAG_DISABLE | N/A | All-miss |
| 7 | Winding swap + FLAG_NONE | N/A | All-miss |
| 8 | Geometry scaled 10× (XY only) + FLAG_DISABLE | N/A | All-miss |
| 9 | Sample point z-offset: 0.0 → 0.01m | All-hit | All-miss |
| 10 | ClosestHit program added to hitgroup | All-hit | All-miss |
| 11 | AnyHit t-filter (`hit_t < t_min` → `optixIgnoreIntersection`) | All-hit | All-miss |
| 12 | Single-file PTX (all programs in one compilation unit) | All-hit | All-miss |
| 13 | Pipeline flag: `ALLOW_SINGLE_GAS` → `ALLOW_ANY` | N/A | All-miss |
| 14 | **Standalone test (1 large triangle)** | ✅ CORRECT | ✅ CORRECT |
| 15 | **Empty BVH (triangle at infinity)** | ✅ CORRECT | ✅ CORRECT |
Full debug history: [link to docs/gpu-occlusion-debug.md]
Question: Are there known issues with OptiX 7.7/9.1 intersection precision for small CAD triangles (centimeter-scale)? Any recommendations for further debugging?