Search code examples
unity-game-engineshader

How to make a blink shader?


I want my gameobject Fade from red to white,and repeatedly.

so i create one shader,like this , but i'm not sure how to turn red then white,and repeatedly.

enter image description here


Solution

  • I believe this is what you're looking to do. It is pretty straight forward you're just blending between two colors and controlling the opacity with the sine of time.

    Shader Graph Example

    An additional note you can alter the behavior of the blink by replacing the sine node with any of the wave nodes (E.g square wave for a strobe effect).