3 ms·
Only if you have more than 1 bounce. Otherwise it’s the same. You’ll cast a ray and get a result.
by reactordev 1y ago
Only if you have more than 1 bounce. Otherwise it’s the same. You’ll cast a ray and get a result.
- pclmulqdq 1y agoNo, searching the set of triangles in the scene to find an intersection takes non-constant time.
- cubefox 1y agoI believe with an existing BVH acceleration structure, the average case time complexity is O(log n) for n triangles. So not constant, but logarithmic. Though for animated geometry the BVH needs to be rebuilt for each frame, which might be significantly more expensive depending on the time complexity of BVH builds.
- pclmulqdq 1y agoYeah, this search is O(log n) and can be hardware-accelerated, but there's no O(1) way to do this.
- cubefox 1y agoWhat if we keep the number of triangles constant per pixel, independently of scene complexity, through something like virtualized geometry? Though this would then require rebuilding part of the BVH each frame, even for static scenes, which is probably not a constant operation.
- reactordev 1y agoFor static geometry we could but for animated geometry or dynamic geometry it would have to be calculated during a mesh shader step.
- account42 1y agoIt's also only O(log n) if the scene is static. Which is what is often missed in the quest for more photo-realistic graphics - it doesn't mean anything if what you are rendering only looks realistic in still frames but doesn't behave realistically if you try to interact with it.