Does Graphics.Blit() draw a fullscreen quad or just a single triangle

Hi guys,

I was wondering whether Graphics.Blit draws a single triangle that covers the whole screen or a quad made of two triangles.

The docs say it draws a full-screen quad, if this is the case, is there a specific reason to not use a single triangle instead?
I know it is less intuitive to use one big triangle, but it can save some computations along the border of the triangles in the quad.

Thanks,
Tigran

Most screens are rectangles, which require two triangles (a quad) to cover completely.

1 Like

You can draw a triangle that is bigger than your screen and adjust the texture coordinates.
The rest will be clipped away anyway.

You could do that. I’m not sure, but I think it might get more difficult to perfectly match pixel coordinates on larger screens with odd dimensions. In any case, what benefit are you hoping for? A single extra triangle is likely actually completely free on a graphics card.

Well, you’ll only need to do some math once to get the texture coordinates right,
As for the benefit: When pushing two triangles to the graphics card, these triangles are rasterized separately on the GPU, so the pixels on the border of the two triangles in the quad will be rasterized twice and some pixels will be processed twice.

It’s not huge, but it’s definitely more than just the one triangle.

1 Like

I was more concerned about precision issues rather than the math being difficult.

Are you sure those border pixels are rasterized twice if the triangles are part of the same mesh? I honestly don’t know the specifics, but graphics hardware designers are pretty good at optimizing these sorts of things.

By the way, I see that this is what you were getting at in your original post, so I’m sorry for my patronizing first response.

1 Like