Last Frame Occlusion Query

Started by
2 comments, last by Mava_b 15 years, 8 months ago
Hello, Is it possible to use the occlusion info from the last frame in the current frame ? I want to try and avoid rendering my scene 2 times to get the occulsion info, is it possible (seems reasonable to use the last frames occlusion tests for the current frame) ? I dont mind being one frame behind so I just need to know if its possible and maybe some pointers on how to achieve it. Thanks.
Advertisement
Are you talking about reusing a particular occlusion dataset over several frames, or having the occlusion dataset always lag the rendering by a frame or two? (In either case, yes.)
well I am new to this occlusion query technique but basically in the code I have written I have to render my scene initially to get the depth info (call this pass 1) and then render again with the queries to find out how many pixels are being drawn (call this pass 2). What I was wondering was can you use (ignoring the first frame) the last frames depth info (pass 1) to occlude in the main draw (pass 2). Basically I will only be drawing my stuff once and use the previous frames occlude info.

Do you have, or know of, a sample in directx9 by any chance ?
You would have to skip the occlusion on the first frame otherwise you would always get nothing :)

It sounds like if you did use the previous then an object would occlude once and you'll never get it back.

So if an object is not visible in the previous frame, and we use this frame for the query, then for the next frame its not visible and not rendered. From here my guess is that the render for that mesh would then _never_ be called again.

Changing the view would not make a difference because you won't ever get the 'positive' call back to say that the object is visible (because you won't have called the render function on it to get a previous frame to work with ie. you won't have a pixel on it at all).

I hope that makes some sense and would like to hear other peoples thoughts on it. I use low poly meshes for my DX9 query and it works perfectly with the increase in frame rate surpassing the cost of rendering the query to a sperate buffer.

Mava :)

This topic is closed to new replies.

Advertisement