spatial query

I need a fast solution to do the query: give me the batches in this region of space for projective texturing. I don’t want to render half the batches in the app just to do projective texture, say, a small part of the floor or wall. I suppose a fine subdivision of space is necessary to achieve fast results. More than one solution is available, I know, trees, grids…

Say, if I take BSP trees, how fine does the subdivision have to be to achieve good results, i.e. so that not too many batches are projective textured. I know with modern GPUs the batch size does not matter much (i.e. big batches are a good thing), but the number of batches still does. How deep does the tree have to be?

Is it a good idea to cull the batches outside the proj. texturing frustum? Do you associate a BV with batches in your apps?

Sure, you usualy cant render the whole world with every projective texture, light source or shadow buffer.

I advise against subdividing here and BSP trees may not work good for modern 3D scenes. You probably make the scene even slower that way.

With fast moving projective textures you need a good and effecient culling that operates on the original meshes. In a modern 3D scene i would go with Octrees, maybe Portals. Probably you may use methods you can also use with the normal view frustum culling, so you can optimize both at the same time.

With static projective textures you can make duplicates of the scene meshes, clip every polygon against the projected frustum and store the result for the rendering.

About octrees. Why do you think they would perform better than the alternatives? I was thinking about trying out hierarchical grids and AABB trees. The thing about octrees I don’t like are their multiple levels and inflexibility (you can size the AABB any way you want), but on the other hand, you can cull them fast, but that also goes for AABB trees.

The think about hierarchical grids is you can find the neighbor of a cell in the grid very fast. I was going to fog out the rest of the cells.

With static projective textures you can make duplicates of the scene meshes, clip every polygon against the projected frustum and store the result for the rendering.

Would clipping matter that much? Say I got some tris on the periphery sticking out of the projective frustum. Would it be a great tragedy to render those?

I guess the culling you mentioned works equally good. I don’t see a big difference.

Of course you can skip clipping and see how it works.