I’ve been trying to create my own toon water shader for the past couple of days and I’m almost done. The only thing is, I just have boring, stand-still water graphics. Can someone show me how I can make the two textures in my shader script move sorta like the Simple Water Day/Night prefab; the normal map and base tex kinda cross each other.
I’m kinda new to this whole shaders thing in unity so take it easy with the big words(jk). I catch on pretty fast. Here’s what I got so far:
Shader "Toon/Water"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base", 2D) = "" {}
_BlendTex ("Under Tone", 2D) = ""
_BlendAlpha ("Blend Alpha", float) = -3.0 //-3 as default
}
SubShader
{
Tags { "Queue"="Geometry-9" "IgnoreProjector"="True" "RenderType"="Transparent" }
Lighting Off
LOD 200
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Lambert
fixed4 _Color;
sampler2D _MainTex;
sampler2D _BlendTex;
float _BlendAlpha;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = ( ( 1 - _BlendAlpha ) * tex2D( _MainTex, IN.uv_MainTex ) + _BlendAlpha * tex2D( _BlendTex, IN.uv_MainTex ) ) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Transparent/VertexLit"
}
If someone could help me out, I’d appreciate it!