Hi
I need to get all visible spatials on scene. Visible in this case means that at least one pixel on screen belongs to this spatial.
Additional info: game has first-person camera and all spatials I need to check are billboards (camera-oriented quads like in Doom).
I’m not proficient in game enignes but as I know, there 3 steps where game engine “filters” geometry (by the way, is it correct to call all these things “culling”?):
- hide all that outside of camera frustum
- hide all backfaces (most likely it’s done on GPU, but backfaces are not critical in my case)
- hide all triangles that are obscured by another triangles
So looks like, engine is already does all I need every frame. Is there a way to ask engine which triangles wasn’t filtered out last rendering frame and identify Spatials associated with them?
Alternative - raycasting, but that must be much slower and I’ll need to perform some accuracy decreasing heuristics to make it fast enough… and it’s already done by engine, so I do not like this approach.
Also, maybe there are another approaches?