Particle trails

Started by
3 comments, last by OrangyTang 15 years, 7 months ago
I need to produce some particle trails in OpenGL ES - do you have any suggestions on a good technique? I thought about just recording the positions of the particle as it moves and render smaller alpha'ed versions but that would introduce errors as they move faster.
ByronBoxes
Advertisement
Fade the alpha channel based on the time elapsed since the creation of that particle...
draw a stretched quad orientated in the particle's moving direction, fade out the colors at the quads tail

p0,p1 are 2 positions, the pos + the direction its moved from

VEC3 q = cameras_position - p0;
VEC3 w = p1 - p0;
VEC3 n = return_VECTORS_normal( CROSSPRODUCT( q,w ) ) * width;

add+subtract n to the p0+p1 verts to get the 4 corners of the quad


I thought about doing that but in my mind I have a vision of a longer trail which could be composes of the length of the particles travels but it would look angular.... I wanted something smoother.
ByronBoxes
If you want highest quality then you could store the previous N positions and string a quad strip along them with vertex colours to fade out the particle texture. That'd get you nice variable length trails which curve smoothly but it'd be a bit more expensive in terms of storage and poly count.

This topic is closed to new replies.

Advertisement