Archived

This topic is now archived and is closed to further replies.

level10boy

Clearing optimization not working

Recommended Posts

Here is text explaining how to optimize backbuffer clearing in the DirectX documention. "Applications that render scenes covering the entire area of the render-target surface can improve performance by clearing the attached depth and stencil buffer surfaces, if any, instead of the render target. In this case, clearing the depth buffer causes Microsoft® Direct3D® to rewrite the render target on the next rendered frame, making an explicit clear operation on the render target redundant. However, if your application renders only to a portion of the render-target surface, explicit clear operations are required." Ok, I''ve the depth/stencil buffer enabled while rendering to the entire area of the target and clearing only the depth and stencil buffer. However, the above optimization does not work and I still have to clear the render target surface. Any suggestions, thanks

Share this post


Link to post
Share on other sites
This technique can only be used if you are going to write over every pixel on the back buffer for your next frame. Are you saying that you''re writing over every pixel and still seeing pixels left over from the previous frame? If that''s the case then the Z-buffer didn''t get cleared.

The clear operation happens in hardware and is extremely fast, so I would doubt you''ll notice any huge performance gain by using this technique.

Share this post


Link to post
Share on other sites