Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

HexDump

Using 4 vertices instead of 6 in order to render a particle in dx8.

This topic is 5963 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

Hello, As I said in my previous post I´m building a little particle system. Now I need to render the particles (I´m using billboarding), so, I thought I would need only 4 verts to render each particle cuad. But... I don´t want to use a DrawPrimitive to render each particle, I want to have a big chunk of verts and then render them in a single call to drawprimitive. Is there a way to make this with dx?. Now I have a triangle list (2 triangles per particle) in order to render the particles but this does 6 verts by particle :/, too much wated space + cpu time. Any suggestion?... Sorry for my poor english. Cheers, HexDump.

Share this post


Link to post
Share on other sites
Advertisement
the problems with point sprites is that not all cards out there support them, so... I prefer to stick with billboards.

Share this post


Link to post
Share on other sites
You should use only four vertices per quad and a triangle fan to render.

50% gain !


Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/home/play_starshooter.htm

Share this post


Link to post
Share on other sites
oops...

ok my bad, next time, I will read the question twice before posting.


Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/home/play_starshooter.htm

Share this post


Link to post
Share on other sites
oki I have checked IndexBuffers and DrawIndexedPrimitive, but for this I need 4 verts + 6 indexes :/, is it better than 6 verts?.

Another question, here I can´t use triangle strip, am I right? because if I do it, all triangles will be merged, it tthis right?

Thanx in advance.
HexDump.

Share this post


Link to post
Share on other sites
G''day!

You CAN use strips, you just have to stitch them together using degenerate triangles. I doubt it''d be much of a win. Stitching strips together is usually used to connect long strips where the overhead of the stitch is insignificant.

Indexed strips will likely be better. Fewer vertices mean fewer transformations. The size of your vertices is likely a lot larger than the size of an index.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by HexDump
oki I have checked IndexBuffers and DrawIndexedPrimitive, but for this I need 4 verts + 6 indexes :/, is it better than 6 verts?.

Yep - each index will only be 2 bytes (don''t try to use 32bit indices - they aren''t supported on all hardware).
But each of your vertices will be much more than that (12 bytes just for the position, another 4 for a diffuse colour, another 8 if you''ve got one texture).

And batching is (in general) more important than memory concerns.

John B

Share this post


Link to post
Share on other sites

  • 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!