Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

degenerate triangles fragment generation

Can I safely assume that, in polygon fill mode, with no culling, using VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, a degenerate zero area triangle (with all vertices sharing the same index) will always produce zero fragments (with or without multisampling)?

The specs (1.3.228) explicitly addresses degenerate zero area triangles only in the context of the VK_EXT_conservative_rasterization extension:

"Implementations can process degenerate triangles and lines by either discarding them or
generating conservative fragments for them. Degenerate triangles are those that end up with zero
area after the rasterizer quantizes them to the fixed-point pixel grid."

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I am not using conservative rasterization, and I cannot find any reference that clarifies weather this case is actually guaranteed to generate zero fragments, or is otherwise left implementation-dependant (which may have unexpected results like generating a single fragment).

>Solution :

The standard doesn’t need to state this explicitly. It is a natural consequence of the rasterization rules. Specifically:

Fragments are produced for any fragment area groups of pixels
for which any sample points lie inside of this polygon.

If the polygon has no area, then no samples can lie inside of it, and therefore no fragments can be produced from it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading