Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

How to rasterize a triangle even if it's not covering pixel center

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

I have a very low resolution render target in which I render light volumes. The problem is that it's so low-res that the triangles of the light bounding sphere geometry don't even get rasterized unless they're large (relative to the screen surface area) or directly at the pixel center. This is causing severe popping.

I guess one way would be to dynamically adjust light volume size, but are there any methods to trick the rasterizer to draw the triangle anyway?

Share this post


Link to post
Share on other sites
Advertisement
This is called "conservative rasterization", and isn't supported by GPU's. Using MSAA helps by adding more sample points, but isn't really a solution. The only way I know of to do it on graphics hardware is to enlarge your triangles by an amount large enough to ensure they cover the sample points. This older article discusses how to do that using DX9-era hardware. But if you're using DX10-capable hardware you can do it on-the-fly in a geometry shader. You can also avoid the corner issue by discarding fragments in the corner in the pixel shader, rather than adding more edges to your triangle. This is the approach used by Cyril Crassin in his GPU voxelization pipeline.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!