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?