Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have objects moving in OpenGL ES1 application. I want some of them to leave behind contrail – like if they would emit some radiation or something.

EDIT: the kind of contrail is:

  • light contrail – not smoke contrail,
  • the same effect occurs on LCD monitors with long pixel-switch time (it is called response time AFAIK).

HERE IS THE EXAMPLE IMAGE: http://i.imgur.com/Fcb24.jpg

share|improve this question
2  
Please edit your question to describe in more detail what you've tried already. Also show us some screenshots of what you have now and an example of what kind of effect you're trying to achieve (e.g. from another game or movie, or real life). –  Nathan Reed Jul 25 '12 at 21:28
    
@NathanReed: is it better now? –  GoCoder Jul 25 '12 at 22:25
1  
No, not really. You haven't described what research you've done or ideas you've tried already. Nor have you posted an image to give us a concrete idea of what your desired effect would look like. We can't read your mind! It's not likely you'll get good answers unless you can ask your question much more fully and completely. –  Nathan Reed Jul 25 '12 at 22:49
    
@NathanReed: I have attached an example image –  GoCoder Jul 26 '12 at 12:05
add comment

1 Answer 1

The example image makes it much clearer what you want. "Contrail" probably isn't the right word for this; at my company we call it a "swoosh" but other people probably call it something like "sword trail", "sword slash" or similar.

Anyway, the way to do this is basically to generate dynamic geometry, by recording the position of two points on the sword (one at the hilt, one at the tip) each frame and keeping a history for the last n frames. Then draw a triangle strip that connects these points, with a translucent or additive shader.

To make it look better, you'll probably want to fade out the trailing edge of the swoosh, e.g. using vertex alpha based on the age of each vertex. You can also generate UVs for each vertex so you can put a texture on the swoosh. Finally, if sampling the sword once per frame doesn't give you smooth enough geometry, you can interpolate additional vertices using Hermite splines (these require calculating the velocites of the two sample points each frame, which are used as tangent vectors for the splines).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.