Code editor in gradient material.
  • JimTurner
    member
    Posts: 12
    Joined: Tue Jan 08, 2019 11:49 am

    Code editor in gradient material.

    by JimTurner » Wed Mar 09, 2022 10:42 am

    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!
  • mad-matt
    garageCube team
    Posts: 1478
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: Code editor in gradient material.

    by mad-matt » Wed Mar 09, 2022 3:10 pm

    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.
  • JimTurner
    member
    Posts: 12
    Joined: Tue Jan 08, 2019 11:49 am

    Re: Code editor in gradient material.

    by JimTurner » Thu Mar 10, 2022 1:27 pm

    Many thanks, i shall have a look...

Who is online

Users browsing this forum: No registered users and 27 guests