Jump to content
  • Advertisement
Sign in to follow this  
Christopher Harris

Sprites: Quad verses Over-sized Tri

This topic is 4491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Plus if you wanted to have more than one of these lined up it would be hard to align them correctly.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!