Topic was automatically imported from the old Question2Answer platform.
Asked By
Flying_cupcake
I have a sprite and i am going to want to apply a shader to it when my mouse hovers over it. I have some working code for the shader, but I am stuck when it comes to turning it on and off at will. Is there some bit of code that allows me to target the shader in some sort of choice to have it ON or OFF as needed.
You can influence shaders code from GDScript by set_param() method
It will influence any shader variable introduced as uniform
So You can create uniform boolean variable in shader and calculate effect with it.
For example :