Very small triangle

Hi All,

In our app we can’t display a triangle with vertex coords like:

0,0 | 1e-6,0 | 0,1e-6

If we draw lines between these three vertices we can see them but not polygons.

If we change the coords as:

0,0 | 1e-5,0 | 0,1e-5

The triangle is visible.

We double checked near and far planes settings and everything seems ok. What else should we check?

Thanks,

Alberto

What is the surface in pixels of such a triangle ? If less than 0.5 pixels², then it is normal that the triangle produces no fragment. Try with utra high MSAA (16x), to see if it is better.

If less than 0.5 pixels², then it is normal that the triangle produces no fragment.

Not quite true. The triangle can “cover” a pixel, even if it is smaller that a pixel or half a pixel. What matters is, if the pixel center lies within the triangle or not. So for a very small triangle, it may or may not leave a pixel, depending on its position on the screen - which could be what the OP is observing.

Edit:
I forgot! Also be aware that line rasterization is completely different from triangle rasterization. That explains why you can see the lines, but not the triangles.

Conservative rasterization generates fragments if the triangle intersects any fraction of a pixel, and not just its center.

http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter42.html

I’m sure that it works because on the same machine the same triangle can be drawn with a earlier version of our program. We compared all the OpenGL source code and didn’t find anything relevant.

I was asking a clue to inspect in more depth.

Thanks,

Alberto

Considering we have two versions of the same program, one that can render the small triangle and the other that cannot. If we sniff GL calls we should discover where the difference are, right?

Can you please provide us a link to download one of them? I remeber something glDevil, but it isn’t the exact name.

Thanks,

Alberto

glIntercept

Oh, yes. That’s was the name. Already downloading it…

Thanks,

Alberto