TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

Animation of the emission shader parameters (color and intensity) #4735

Closed saccoforino closed 1 year ago

saccoforino commented 1 year ago

I suggest to improve the possibility of animating the shader emission of a material so as to be able to vary over time in intensity and color (example: a flashing luminous surface or with a variable colour).

MonkeyFrogStudio commented 1 year ago

I believe this can be done via lua. I think one of the Behaviors already does some of this.

davetgc commented 1 year ago

@MonkeyFrogStudio is correct. I'm not at my development machine, but there is a behavior that already does this, maybe someone can jump in before I get a chance to look at point the correct one out :).

MonkeyFrogStudio commented 1 year ago

I know there's a behavior that can change the color of emissive, but I'm not sure it can alter the intensity of it over time.

MonkeyFrogStudio commented 1 year ago

@davetgc

There is the Pulsecontrol Behavior, which will control the intensity of emissive. It has a few controls for "increase", "decrease", and "pulse", but I don't see that it changes color.

Then there is the Atlas Changer. It allows for the changing of an atlas texture (up to three can be used) and an emissive value to be set. Since you can change the texture, this means that emissive can be changed as well (via which texture is being used).

There is also the Glow Behavior. This will allow the variance of the strength of the emissive value and the control of the speed of change for that value.

So, I don't see one, single Behavior that would both control the intensity of the emissive value AND change the color of the emissive. The change color part would be nice, especially if the Behavior would cause it to slowly change from one color to the next, sort of like how yellow would turn to blue, getting green in the middle, etc.

davetgc commented 1 year ago

I've passed this on to our excellent scripter to see if he can advise.

Necrym59 commented 1 year ago

You can set the color in the materials tab for the emmisive color for use in Pulsecontrol, what more are you after, the only thing is left is a color cycler to drift though the millions of color combinations but it wouldnt be very effective. Can you cite a specific use for such a change and how you would expect it to work. Do you want it to change from the base colour to one specified perhaps.

MonkeyFrogStudio commented 1 year ago

@Necrym59 Well, based on what the OP said, the ability to change emissive color as well as intensity. I gave an example of emissive changing from yellow to blue above in my previous post. There's no need to cycle through millions of colors, of course. So, imagine a light that goes from dim to bright red to dim red again, then from dim to bright blue back to dim blue again, then repeats the cycle.

Necrym59 commented 1 year ago

done and updated

davetgc commented 1 year ago

Thanks.