Sign in to follow this  

Last Frame Occlusion Query

This topic is 3413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

This topic is 3413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this