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

Started by
7 comments, last by HexDump 21 years, 12 months ago
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.
Advertisement
Look into indexed triangle lists.
(ie IndexBuffers and DrawIndexedPrimitive)

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
or point sprites. i prefer them for my p-engine

[Edited by - kmsixpence on October 17, 2005 6:14:46 PM]
the problems with point sprites is that not all cards out there support them, so... I prefer to stick with billboards.

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
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
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.
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
Stay Casual,KenDrunken Hyena
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
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.

This topic is closed to new replies.

Advertisement