Home Technical Talk

Q3 fire scroller shader

polycounter lvl 14
Offline / Send Message
leilei polycounter lvl 14
How would one do a shader script that:

- stage one would scroll an additive fire texture upward, the 'fireball' stuff
- stage two would 'alpha' this out to a blob shape where we don't get seams and such ugliness, and make it look more like an actual fire.

I used to have this all printed out but it's all gone now, to a better place. frown.gif

fine examples: Fires in Zelda64 (though alpha blend there), Gargantua fire/rocket trail in Half-Life.

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    why not just use an animated texture? :O
  • Eric Chadwick
    I'd guess because animated textures eat up memory, scrollers don't.
  • Showster
    Offline / Send Message
    Showster polycounter lvl 18
    What I would do is use particle studio, setup a decent fire texture and then setup a basic flickering fire emitter / smoke trail for instance.

    Then you end up with a shader like this

    textures/floorsos/smokepuff3_1
    {
    qer_editorimage textures/floorsos/smokepuff3.tga
    surfaceparm noimpact
    surfaceparm nolightmap
    cull none
    surfaceparm trans
    surfaceparm nonsolid
    surfaceparm nodlight
    deformvertexes autosprite
    deformvertexes move -7.347877 9.003964 544.157837 sawtooth 0 1 0.836573 0.038147
    {
    clampmap textures/floorsos/smokepuff3.tga
    tcMod rotate 0.000000
    AlphaGen wave sawtooth 1.000000 0.000000 0.836573 0.038147
    rgbGen wave sawtooth 1.000000 0.000000 0.836573 0.038147
    tcMod stretch sawtooth 1.000000 0.000000 0.836573 0.038147
    blendfunc blend
    }

    Apart from you would have maybe 10-20 shaders for each animation / sprite and would need to model 10-20 brushes to apply the different stages of the shader to.


    So in this case Smokepuff 3_1 is the first frame of the smoke animation, then it is up to you and particle studio in how many additional smoke puffs you want.

    Here is a link.

    http://freebrief.planetmedalofhonor.gamespy.com/q3a/ps/index.html

    It is basically the same as the UT sprite engine but without the useful UI and workflow lol.

    Good luck

    Greg
  • HarlequiN
  • leilei
    Offline / Send Message
    leilei polycounter lvl 14
    [ QUOTE ]
    why not just use an animated texture? :O

    [/ QUOTE ]
    because they're cheesy and don't look great with interpolation, anyway.

    [ QUOTE ]
    What I would do is use particle studio,

    [/ QUOTE ]
    good luck using that for stuff like models that aren't mapobjects!

    [ QUOTE ]
    http://www.bpeers.com/software/q3ase/

    [/ QUOTE ]

    that's just a program, and it's also a different shader engine than what q3 uses (different deformVertexes and envmap, no specular etc)

    where's daemon when you need him!
  • Xenobond
    Offline / Send Message
    Xenobond polycounter lvl 18
    I have NEVER had any problems with q3ase when it came to doing shader work for ANY quake3 engine based game.

    It's the same principle, though. Use a second texture as the alpha map for the layer preceding. I think the term was depthWrite.

    Might also try a multiplied cloudy layer on top of the firey stuff if it's being applied as an additive effect.
  • leilei
    Offline / Send Message
    leilei polycounter lvl 14
    aHA! Depthwrite is what I was looking for. I have to put the alpha blob on the FIRST layer however.

    Thanks Xeno!
    fireyu4.jpg
  • HarlequiN
    Offline / Send Message
    HarlequiN polycounter lvl 18
    Q3ASE was written from the ground up specifically for Q3. That's why it's called *Q3*ASE smile.gif

    Yes, it's "just a program", but it's remarkably self explanatory, and just messing around with it can get you probably get you the result you want reasonably quickly.

    I'd tell you how to do it if I could remember how, but I can't, so Q3ASE is all I got to offer.

    Anyway, you got it working now.
  • leilei
    Offline / Send Message
    leilei polycounter lvl 14
    for reference
    <font class="small">Code:</font><hr /><pre>
    yourshader
    {
    {
    // THIS IS THE ALPHA BLOB, this makes the fire fade off. This texture MUST have an alpha channel!
    map textures/fireblob.tga
    blendfunc gl_zero gl_one_minus_src_color
    depthWrite
    }
    {
    // THIS IS THE ADDITIVE FIRE EFFECT that scrolls up
    map textures/firescroll.tga
    blendfunc gl_one_minus_dst_alpha gl_src_alpha
    tcMod scroll 0 2
    }
    }
    </pre><hr />
Sign In or Register to comment.