BlueBear icon

LFade.shader

BlueBear | PRO | 03/21/14 11:25:42 AM UTC | 0 ⭐ | 383 👁️ | Never ⏰ | []
C |

2.02 KB

|

None

|

0 👍

/

0 👎

Shader "Custom/LFade" {
    Properties {
        _Color ("Main Color", Color) = (1, 1, 1, 1)       
        _DawnTex ("Dawn (RGB)", 2D) = "white" {}
        _DayTex ("Day (RGB)", 2D) = "white" {}
        _DuskTex ("Dusk (RGB)", 2D) = "white" {}
        _NightTex ("Night (RGB)", 2D) = "white" {}
        _ViharTex ("Storm (RGB)", 2D) = "white" {}
        _Csuszka ("Day cycle", Range (0,4)) = 2.0
        _ViharCsuszka ("Storm scale", Range (0,0.9)) = 0.3
    }
    SubShader {
        Tags { "RenderType"="Opaque" "IgnoreProjector"="True" }    
        
        Pass
        {       
            Tags { "LightMode"= "Always" }
            Lighting Off
            SetTexture[_DawnTex]
            SetTexture[_DayTex]
            SetTexture[_DuskTex]
            SetTexture[_NightTex]
 
        }
        
        CGPROGRAM
        #pragma surface surf Unlit noambient novertexlights noforwardadd
        #pragma target 3.0
 
        sampler2D _DawnTex;
        sampler2D _DayTex;
        sampler2D _DuskTex;
        sampler2D _NightTex;
        sampler2D _ViharTex;
        float _Csuszka;
        float _ViharCsuszka;
 
        struct Input {
            float2 uv_DawnTex;
            float2 uv_DayTex;
            float2 uv_DuskTex;
            float2 uv_NightTex;
            float2 uv_ViharTex;
        };
 
        void surf (Input IN, inout SurfaceOutput o) {
            half4 dawn = tex2D (_DawnTex, IN.uv_DawnTex);
            half4 day = tex2D (_DayTex, IN.uv_DayTex);
            half4 dusk = tex2D (_DuskTex, IN.uv_DuskTex);
            half4 night = tex2D (_NightTex, IN.uv_NightTex);
            half4 storm = tex2D (_ViharTex, IN.uv_ViharTex);
            half4 output;
            if(_Csuszka <= 1)
            {
                output = lerp(dawn, day, _Csuszka);
            }
            else if(_Csuszka > 1 && _Csuszka <= 2)
            {
                output = lerp(day, dusk, _Csuszka - 1);
            }
            else if(_Csuszka > 2 && _Csuszka <= 3)
            {
                output = lerp(dusk, night, _Csuszka - 2);
            }
            else if(_Csuszka > 3 && _Csuszka <= 4)
            {
                output = lerp(night, dawn, _Csuszka - 3);
            }
            
            
            
            half4 viharedOutput = lerp(output, storm, _ViharCsuszka);
            
            o.Albedo = viharedOutput.rgb ;
        }
        
        half4 LightingUnlit(SurfaceOutput s, half3 lightDir, half atten)
        {
            return half4(s.Albedo, s.Alpha);
        }
 
        ENDCG
    } 
    FallBack "Diffuse"
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Syutrsz icon
    03/31/26 10:21:59 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎