This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

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?

Answers

  • sent44sent44 Posts: 27Member

    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
        }else{
            // gray color and spare vertex
        }
    }
    
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.