Sprites: Quad verses Over-sized Tri

Started by
6 comments, last by sirob 18 years ago
So, I was thinking one day and realized that we are using two triangles (a quad) to render a flat surface. Why wouldn't we just use one oversized triangle? Example: Is it harder for the GPU to render 2 triangles, or one triangle thats 1.5 times the size of the combined area of the 2 triangles...
Advertisement
How do you expect to not draw the other parts of the triangle? Any solution would likely require much more processing power than just drawing two triangles.

Also, point sprites offer a much better option for these cases.
Sirob Yes.» - status: Work-O-Rama.
Plus if you wanted to have more than one of these lined up it would be hard to align them correctly.
It's not a bug... it's a feature!
sirob, In DirectX (c++):

device->SetSamplerState(D3DSAMP_BORDERCOLOR, 0x00000000);
device->SetSamplerState(D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
device->SetSamplerState(D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);

Would that not work?
The issue I see with this approach is that it would undermine the use of many sprites in one texture.
It's a tradeoff. You process 25% less vertices, but 100% more pixels (depending on the shape and other things).
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
I think you'll find that with any kind of 2d work you'll be much more limited by fill rate than geometry thoughput (so the triangle method would be a bad idea).

Don't take my word for it though, benchmark it. [grin]
You'd need to enable Alpha Testing, as a minimum. This would have an impact on all pixels' render speed.

Also, I remember reading somewhere that only CLAMP, MIRROR, and WRAP actually work in full speed, and that the other types suffer some speed impact.

As a final note, micro-optimization is tha evil.

Quote:Original post by OrangyTang
I think you'll find that with any kind of 2d work you'll be much more limited by fill rate than geometry thoughput (so the triangle method would be a bad idea).

Don't take my word for it though, benchmark it. [grin]

I think this would highly depend on how big the sections you draw are. If you need to draw in 2x2 pixel areas, you probably won't be fill-rate limited.
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement