Hi there
alright i had an idea and i'd like you folks to tell me what it's worth. As i don't have half of the skills needed to exploit my idea, i'd be great if someone could try it =)
The idea between Limited Range Camera is the same as a limited range light : i'll talk about if-statement as if we all have sm3.0, but, hey, in a few years we will. Plus, Humus showed us that dynamic branching could be achieved fairly on previous sm.
So basicaly, when you render a light with Phong Shading model, you first check if the fragment is in the light range. With Limited Range Camera, the test is not a radius test, but is achieve with a depth map; steps are :
1 - Render the level with texture, the fastest as possible, with depth test on
2 - Make a depth map from the camera's point of view, put it in a cubemap
3 - Render in the stencil buffer :
you get the vector that goes from the camera to the fragment, get its length
get the depth of the closest fragment from the depth cubemap
if the fragment is further than what the depth cubemaps says, do not render it
4 - Render the whole scene where stencil buffer says
The problem no 1 is to get a precise distance from the depth map.
Another is that you need a high res depth map : for a 1024x768 rendering mode, a 1024x1024 map is ok, but if you want higher res, i think you need 2048x2048.
condition of use : you must have a heavy load of work at fragment level for this algorithm to be efficient.
so here's the idea, tell me what you think of it. thanks in advance
wizzo



