Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Shaders / BridgeShader.shader
  1. Shader "Dreamsturbia/BridgeShader"
  2. {
  3. Properties{
  4. _Color("Color",Color) = (1,1,1,1)
  5. _MainTex("Texture", 2D) = "white"{}
  6. _NoiseTex("Noise Texture", 2D) = "white"{}
  7. _DissolveThreshold("Dissolve Threshold", Range(0, 1)) = 0.5
  8. }
  9. SubShader{
  10. Pass{
  11. HLSLPROGRAM
  12. #pragma vertex MyVertexProgram
  13. #pragma fragment MyFragmentProgram
  14. #include "UnityCG.cginc"
  15. struct VertexData {
  16. float4 position : POSITION;
  17. float2 uv : TEXCOORD0;
  18. };
  19. struct VertexToFragment {
  20. float4 position : SV_POSITION;
  21. float2 uv : TEXCOORD0;
  22. float2 uvNoise : TEXCOORD1;
  23. };
  24. sampler2D _MainTex;
  25. sampler2D _NoiseTex;
  26. float4 _Color;
  27. float4 _MainTex_ST;
  28. float4 _NoiseTex_ST;
  29. float _Intensity;
  30. float _DissolveThreshold;
  31. VertexToFragment MyVertexProgram(VertexData vertex)
  32. {
  33. VertexToFragment v2f;
  34. v2f.position = UnityObjectToClipPos(vertex.position);
  35. v2f.uv = vertex.uv * _MainTex_ST.xy + _MainTex_ST.zw;
  36. v2f.uvNoise = vertex.uv * _NoiseTex_ST.xy + _NoiseTex_ST.zw;
  37. return v2f;
  38. }
  39. float4 MyFragmentProgram(VertexToFragment v2f) : SV_TARGET
  40. {
  41. // float4 color = tex2D(_MainTex, v2f.uv);
  42. // float4 noise = tex2D(_NoiseTex, v2f.uvNoise + _Time.x);
  43. // color += sin((_Time.y * 1) + (color * 1)) * 1;
  44. // clip(noise.rgb - _DissolveThreshold);
  45. // float finalColor = color * noise;
  46. //clip(noise.rgb - _DissolveThreshold);
  47. float _Blend1 = 0.4f;
  48. float4 mainCol = tex2D(_MainTex, v2f.uv - _Time.x);
  49. float4 texTwoCol = tex2D(_NoiseTex, v2f.uvNoise + _Time.x);
  50. fixed4 output = lerp(mainCol, texTwoCol, _Blend1);
  51. return output * _Color;
  52. }
  53. ENDHLSL
  54. }
  55. }
  56. }