Posts

Showing posts with the label wave

sin vertex displacement shader

 The following vertex-surface shader moves vertices up and down based on some sine waves and the time variable. Combining lots of waves is a cool way to generate funky displacements. Things to note - we calculate a new normal in the vert function to prevent weird shading issues.  Shader "Dave/Unlit/waves" {     Properties     {         _MainTex ("Texture", 2D) = "white" {}         _Tint("Colour Tint",color)=(1,1,1,1)         _Freq("Frequency",Range(0,5))=3         _Speed("Speed",Range(0,100))=10         _Amp("Amplitude",Range(0,1))=0.5     }     SubShader     {        CGPROGRAM     #pragma surface surf Lambert vertex:vert        struct Input {         ...