Changing the shader across the life of a particle?

Robert_BobbinsonRobert_Bobbinson Posts: 3Member

I have a CPUParticles particle system, and I want it to look like fire.
I want to change the color of the particles across their lifetime so they start a whiteish orange, pass through a red fase, and end up being somoke.
Is there a way to make them change color?
Is there a better way to achieve a fire effect?


  • sent44sent44 Posts: 31Member

    Use TIME
    Maybe also LIFETIME or uniform float current_age

    Maybe you should do something like this

    uniform float current_age;
    void vertex(){
        if(current_age < BABY){
            // whiteish orange color
        else if(current_age < ADULT){
            // red color
            // gray color and spare vertex

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file