Skip to content

Find all objects not intersected by a ray #202

Answered by ingowald
vani-nag asked this question in Q&A
Discussion options

You must be logged in to vote

The RTX "miss" program gets called if a ray has hit NONE of the objects; so that won't work for what you need.

Generally speaking there is no built-in "RTX mechanism" for iterating over all prims not hit by a ray - in all my years of working in ray tracing nobody has ever even asked for that, probably because for most real-world scenes (with millions to billions of primitives) this would be shockingly expensive.

So no, i can't think of any way other than starting with an array of all-ones (one per sphere), and then setting those that got intersected to 0 in an anyhit program. You could try to use a single bit per sphere, but that's still O(N) storage.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vani-nag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants