Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Shader graph - quick pulsating light?

Discussion in 'Graphics Experimental Previews' started by nicmarxp, Jun 18, 2018.

  1. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    When I use Sine Time, it takes about 2 seconds for it to go from -1 to 1. If I try to make it faster by using a multiply or divide node, it still takes the same time, but the animation from black to white happens faster.

    How would I do so it pulsates, like 2 times a second?

    The documentation on Time node is quite sparse.. :)

     
    rgarrett7 likes this.
  2. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    63
    You need get Time multiply on some value (speed) and put into Sin node
     
    Smireles likes this.
  3. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Thanks, I'll try that!
     
  4. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    You can also use the "Random Range" node with the output from time to get the blink going
     
  5. JoeysLucky22

    JoeysLucky22

    Joined:
    May 11, 2013
    Posts:
    15
    To any other newbies (like me) struggling to understand what Chaiker meant, here's a gif:
    SpeedTime.gif

    You can then convert the Vector 1 to a property and rename it "speed"

    I'm still new to shaders and node based material editing and I struggled to find search results for shader graph time speed or shader graph blinking speed but came across this post and @Chaiker comment helped make it click so thank you!
     
  6. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Thanks, I actually never tried it, since I abandoned the LWRP, but I'm trying it again now, so thanks a lot :)
     
    JoeysLucky22 likes this.
  7. unity_ChzMQh2vjQVG4g

    unity_ChzMQh2vjQVG4g

    Joined:
    Oct 14, 2018
    Posts:
    1
    SpeedUpSin.PNG

    Feed time as "x" to sin(x) and multiply time with a number to speed it up. "Sine" in the image will pulse.
     
    Neohun likes this.
  8. froslyakov

    froslyakov

    Joined:
    Dec 28, 2018
    Posts:
    5
    Hey , does anyone know how to make transition sharper / smoother?
     
    Last edited: Jul 11, 2019
  9. belgarion01

    belgarion01

    Joined:
    Dec 1, 2017
    Posts:
    2
    To make it sharper, just put a step node after the remap one :

    upload_2019-9-29_18-4-15.png