Jump to content
  • Advertisement
Sign in to follow this  
NiGoea

Particle quick question

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

Hi ! To make a particle system, do you prefer using pointsprite or normal quads (sprite) ? What do you suggest (for an FPS engine) ? thanks !!

Share this post


Link to post
Share on other sites
Advertisement
Quads tend to be more flexible I would say. In case you are using D3D 10 (and upwards) pointsprites aren't really supported by the API, but you could use a geometry shader instead.

Share this post


Link to post
Share on other sites
I prefer normal quads. It gives you more flexibility, like stretching a spark particle, or tumbling a leaf particle.

Share this post


Link to post
Share on other sites
Are pointsprites rendered with the center offscreen in DirectX? If not, another vote on quads.

Share this post


Link to post
Share on other sites
Thanks you guys !

I was just thinking about the fact that with quads you have to send 4 vertexes for each quad, instead of just one needed by a pointsprite.

Quote:
Original post by KulSeran
I prefer normal quads. It gives you more flexibility, like stretching a spark particle, or tumbling a leaf particle.


What do you mean with "tumbling a leaf particle" ?

thanks ;)

Share this post


Link to post
Share on other sites
A "smoke" particle might be a screen-facing billboard quad.
A "spark" particle would be a screen-facing billboard that is stretched along the velocity of the particle.
A explosion might have a world oriented shockwave that is parallel to the ground.
A leaf or confetti might rotate or tumble on one or more axis in world space ( for instance a coworker made the effect in
">this using a particle that tumbled on the single long axis of the confetti )

Share this post


Link to post
Share on other sites
Quote:
Original post by NiGoea
I was just thinking about the fact that with quads you have to send 4 vertexes for each quad, instead of just one needed by a pointsprite.

True, but with geometry shaders you can get around that.

Share this post


Link to post
Share on other sites
Thanks !

So let's use quads.
I was looking for a way to have quads always facing the camera.
I found two solutions:

1. Billboards. But this forces to have a DrawPrimitive for each single quad, that is for each particle, because the worldView matrix is different for each particle. It sounds slow to me.

2. Compute world space vertexes for each quad, rotated accordingly to the (inverse) camera matrix. In this way you can pack many particles in a single draw call. But the CPU has to perform lots of vector-matrix mul.

What do you suggest ?

thanks ;)

Share this post


Link to post
Share on other sites
3) Neither.

Use a dynamic VB with world-space coordinates in it, then do the rest of the math on the vertex shader.

Share this post


Link to post
Share on other sites
I'd agree with Rubicon, but I've never done shader particles.
so
Quote:

2. Compute world space vertexes for each quad, rotated accordingly to the (inverse) camera matrix. In this way you can pack many particles in a single draw call. But the CPU has to perform lots of vector-matrix mul.

for billboards, you only need to do vector addition.
Take the world center of the particle, and just add/subtract the camera's up and left vectors to generate your 4 corners.

You could likely do that in a shader too.

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!