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 been wondering now for quite some time, how certain animated texture effects are done, specifically involving light effects.

Some good examples of what I mean are the green bridges in Darkspore, who have a pulsating light effect (pic), the light bridges in Portal or some spell effects from Oblivion (pic).

Are those effects purely done with shaders? And if so, how would you go about doing them? If I for example wished to create an effect, which would send little lightning bolts from a character models feet to the top as illustration that he got electrocuted, how would that work?

To my person: Although I am proficient in programming, I am mostly a beginner, when it comes to shaders. I understand most of the math behind it, but have almost no practical experience with them.

I hope you can clear things up for me a bit!

Thanks you for reading and in advance for any help! Christoph

share|improve this question

1 Answer 1

up vote 1 down vote accepted

These are most commonly done, as far as I know, with a combination of animated texture maps (along with an alpha channel, obviously) — for instance, in the Darkspore example the animated texture would be laid onto a series of essentially rectangles representing the bridge, or in Oblivion as a second texture on the player mesdh — supplemented in some cases by a simple glow shader. There's really no need for a potentially-complicated shader effect when a texture will do the job equally well (and more efficiently).

share|improve this answer
    
Thank you, that really cleared it up a lot. So generally I would now have to create such an animated texture. Are those realized by a series of bitmaps which are applied one after another or how do I have to envision it? –  Chris May 22 '12 at 11:16
    
@Christoph There are a couple of different methods for doing it; one is to have the sort of series of bitmaps you mention, representing the different stages of an effect; this might be used for something more complicated like a shield impact effect. Another is to animate the coordinates of the texture; once upon a time this would have been done in code by passing in new UV coordinates for the vertices of the mesh every frame, but now it's more likely to be done in a shader... (cont) –  Steven Stadnicki May 22 '12 at 15:24
    
...either in a vertex shader that changes the UVs passed into the pipeline (note that you have to be careful with wrap modes for this) or in a pixel shader that computes the UVs based on e.g. the initial (interpolated) UV of the pixel plus a cyclic offset in the U coordinate. –  Steven Stadnicki May 22 '12 at 15:25

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.