Hi, any suggestion on how to change material parameters dynamically in HAXE script?I was trying to change the color of one material gradually for some event. I didn't find any example about this.
Modifying the Fact of a mix shader in your script.
Thanks! but how to access the mix shader and its Fact in the script?
By default the shader compiler bakes everything into the shader when possible for speed. We need something like this: https://github.com/armory3d/armory/issues/451. Looking into it!
@Milo I use the TextureCoordinate node with an Empty object. When you move this Empty, for example its position x represents the value of Fact you need to control..
So if you attach this translation to an Event, then you are able to change the color of one material gradually for this Event.
Remember that you can use this too http://forums.armory3d.org/t/not-reliable-setmaterial-node-maybe-the-solution/720
You can share your experiences then with others here too http://forums.armory3d.org/t/best-switch-colors-method/704
@lubos I see, I will try to do some workaround first.
@DidierThanks! I tried to setup the nodes according to your method, but when I move the Cube, the color is not changing...is there some special setup required?
@Milo I don't remember of special setup. Maybe first test/validate if coords well retreived ?