(09-25-2010, 10:26 AM)top_cat Wrote: Hi guys,
I am a noob to any kind of shader and I'd like to create a fire shader. How do I go about doing this?
Thanks very much.
Fire is just going to be a series of animated textures. Make 4 or more .jpg or .tga files that look like flame. Anything you do in black will be transparent. Make each one look slightly different to give the illusion of the flame flickering. Then write your shader like this:
textures/fire/fire
{
nopicmip
qer_editorimage textures/fire/fire1.jpg
q3map_lightimage textures/fire/fire1.jpg
surfaceparm trans
q3map_surfacelight 600
cull back
qer_trans 0.5
surfaceparm nomarks
{
map textures/fire/fire.jpg
animmap .2 textures/fire/fire1.jpg textures/fire/fire2.jpg textures/fire/fire3.jpg textures/fire/fire4.jpg
}
}
animap will animate fire(1-4) over and over again. the .2 is the delay between each frame. Play with this until you get the speed you are happy with.
Cheers!