Sign in to follow this  

MSAA with non-msaa data

This topic is 1108 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

Hi,

I have a render using non-msaa because I use a FXAA. For the editor I render lines and gizmo at the end after the render of the engine.

I would use MSAA on the lines and gizmo, the problem is my depth buffer is not compatible.

There is a method to convert the depth buffer to MSAA or needs to re-render the scene in the MSAA depth buffer before render gizmo and lines ?

Thanks for the help

Edited by Alundra

Share this post


Link to post
Share on other sites

You can manually fill your MSAA depth buffer with contents of your non-MSAA depth buffer. The easiest way to do this is with a full screen pixel/fragment shader that writes directly to your MSAA depth buffer. Basically you have each pixel sample the depth value from your non-MSAA depth buffer, and the output it using SV_Depth/gl_FragDepth (there's no need to output a color). You can then use your MSAA depth buffer for rendering your HUD. 

 

The major caveat is that this is basically doing an upscale of your depth data with point sampling. Consequently, you won't actually have any sub-pixel data in your MSAA depth buffer after filling it with the contents of your non-MSAA depth buffer. This means that your HUD won't get antialiased results for pixels where your lines intersect with your actual scene geometry. 

Share this post


Link to post
Share on other sites

Maybe the best solution is to render the grid first using a boolean in the engine, and render gizmo at the end on the editor code using a render target using MSAA and composite using alpha blending ?

Edited by Alundra

Share this post


Link to post
Share on other sites

This topic is 1108 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