Sign in to follow this  
Charly7

Particles System OpenSG or GLSL

Recommended Posts

Hi all, I'm tryng to realize a particles system to create a comet tail or a vapor tail for a satellite. I've done a generic particles system in OpenSG (using random points) and than I've create a generic shader to move my particles up and down. But now I don't know how I can go on. 1) Should I have a file with all points that represent my tail or I don't need it? 2) I don't know how can I do to obtain the shader I want. I would something that allows me to create a smoke effect or a vapor tail (like above). So can somebody supply me some shader or OpenSG code to help me? Or also tell me something about my problems? I really need you help and I'll wait for you answers. Thanks in advance. Charly

Share this post


Link to post
Share on other sites
Particle systems are very mathematical, so you don't need to store things in a file, just like spheres, cube, ellipse are can be generate with math.
I think rendering with GL_POINTS will look ugly and perhaps slow. You would need a lot of points. It's better to use textured triangles.

To rendering triangles that are always facing the camera, the left upper modelview matrix can be set to
1 0 0
0 1 0
0 0 1

so that will get rid of rotation and scale component.

There are other ways like computing the vertices in a shader.
Search for billboarding on your favorite web engine.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Particle systems are very mathematical, so you don't need to store things in a file, just like spheres, cube, ellipse are can be generate with math.
I think rendering with GL_POINTS will look ugly and perhaps slow. You would need a lot of points. It's better to use textured triangles.

To rendering triangles that are always facing the camera, the left upper modelview matrix can be set to
1 0 0
0 1 0
0 0 1

so that will get rid of rotation and scale component.

There are other ways like computing the vertices in a shader.
Search for billboarding on your favorite web engine.


GL_POINTS doesn't have to be ugly, you can texture them using OpenGL 2.0 (and earlier versions using extensions i think), this way the points will be billboarded and also faster since you only have to send one vertex per primitive.

Share this post


Link to post
Share on other sites
Rotating of pointsprites can be done with a few fragment shader instructions. And the size limit isn't a big problem if larger sprites would be clipped away by the near plane.

Share this post


Link to post
Share on other sites
These few fragment shader instructions would scale up significantly with some tens of thousands of particles. And for the size, at least in my 7800 the limit is ~63 pixels, which, at least for me, is not adequate. One might need large particles by their nature, not just because they approach the screen ( fog/flames & stuff like that).

Anyway, for many cases, neither rotation nor great size is needed, so it really depends on your requirements. Just don't use simple points. Or lines. :)

Share this post


Link to post
Share on other sites
First of all thanks for your fast replies.

Unfortunately I think I can't solve my problems with your answers cuz those are too technical for me. I'm a noob in shader and OpenSG world. :(
So I have to ask you if you should supply me some code or some example (GLSL or OpenSG) that allows me to understand or to implements the vapor tail or the comet tail that I need.
Thx a lot guys. I'll wait for your essential answers.

Charly

Share this post


Link to post
Share on other sites
There are a million of examples for vapor trail particle systems, as many as fountains I might say. ATI's RenderMonkey has a vapor trail particle system, check it out if you want to see code, but beware of copy-paste.
The logic behind the vapor trail is neither GLSL nor OpenSG specific, you just have to think the function ( or check it out in the examples). For the rest / setup, you should give it a try for yourself first to understand it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this