0
votes

I'm using GLSL for raytracing because this is all happening in browser via WebGL. I can get my object information through to the fragment shader via floating point textures. In looking through the texture to find my object information, I tried to use a for loop with a variable in the expression to say when it was complete. It didn't compile, it wanted a constant expression. I can do this, but it is a dynamic scene, so I don't know how many objects there are going to be.

What's the correct way to find all the objects in the scene?

1

1 Answers

1
votes

You could just compile your shader to include all of the objects in your scene and appropriate intersection tests all called, then when you need to update your scene just include all the scene objects in to the shader and recompile