Page 1 of 1

Code editor in gradient material.

Posted: Wed Mar 09, 2022 10:42 am
by JimTurner
Hi I wander whether anyone can help?
I am trying to adapt the gradient material to suit my needs.
I am using it simply to control a rgb dmx fixture to change color over time.
I needed more colors than the 5 offered by default and have managed in the code editor to add more colors (I needed 7)
What I am unsure of is how the variable "speed" works.
I would like to be able to define the amount of time that each colour last for. So for instance 10 secs per gradient colour at the moment I am adjusting the speed value in the move menu by trial and error and using a stop watch but it would be preferable to understand what the numbers mean!

Re: Code editor in gradient material.

Posted: Wed Mar 09, 2022 3:10 pm
by mad-matt
You can use the "TIME" global uniform. This is the time in seconds since application started.
The "mat_anim1" in Gradient is a generated "animator", it generates actually a "sawtooth" signal. You could also use a timebase if you want a growing value. Check in menu Help / Materials & Surface FX / Materials Documentation.

Re: Code editor in gradient material.

Posted: Thu Mar 10, 2022 1:27 pm
by JimTurner
Many thanks, i shall have a look...