- Shader "Dreamsturbia/BridgeShader"
- {
- Properties{
- _Color("Color",Color) = (1,1,1,1)
- _MainTex("Texture", 2D) = "white"{}
- _NoiseTex("Noise Texture", 2D) = "white"{}
- _DissolveThreshold("Dissolve Threshold", Range(0, 1)) = 0.5
- }
- SubShader{
- Pass{
- HLSLPROGRAM
-
-
-
- struct VertexData {
- float4 position : POSITION;
- float2 uv : TEXCOORD0;
- };
- struct VertexToFragment {
- float4 position : SV_POSITION;
- float2 uv : TEXCOORD0;
- float2 uvNoise : TEXCOORD1;
- };
- sampler2D _MainTex;
- sampler2D _NoiseTex;
- float4 _Color;
- float4 _MainTex_ST;
- float4 _NoiseTex_ST;
- float _Intensity;
- float _DissolveThreshold;
- VertexToFragment MyVertexProgram(VertexData vertex)
- {
- VertexToFragment v2f;
- v2f.position = UnityObjectToClipPos(vertex.position);
- v2f.uv = vertex.uv * _MainTex_ST.xy + _MainTex_ST.zw;
-
- v2f.uvNoise = vertex.uv * _NoiseTex_ST.xy + _NoiseTex_ST.zw;
- return v2f;
- }
- float4 MyFragmentProgram(VertexToFragment v2f) : SV_TARGET
- {
- // float4 color = tex2D(_MainTex, v2f.uv);
- // float4 noise = tex2D(_NoiseTex, v2f.uvNoise + _Time.x);
- // color += sin((_Time.y * 1) + (color * 1)) * 1;
- // clip(noise.rgb - _DissolveThreshold);
- // float finalColor = color * noise;
- //clip(noise.rgb - _DissolveThreshold);
-
- float _Blend1 = 0.4f;
- float4 mainCol = tex2D(_MainTex, v2f.uv - _Time.x);
- float4 texTwoCol = tex2D(_NoiseTex, v2f.uvNoise + _Time.x);
- fixed4 output = lerp(mainCol, texTwoCol, _Blend1);
- return output * _Color;
- }
- ENDHLSL
- }
- }
- }