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?
How to rasterize a triangle even if it's not covering pixel center
2 replies to this topic
Moderators - Reputation: 15026
Posted 22 August 2012 - 03:42 PM
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.