hch
2025-01-07 96af0bdacac686edf379e32ba00f9aa771669cab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Shader "Environment/Lava" {
    Properties{
        _BaseTex("BaseTex", 2D) = "white" {}
        _TillingXYPannerXY("TillingX-Y/PannerX-Y", Vector) = (1,1,0.1,0.1)
        _Power_slider("Power_slider", Range(0, 10)) = 5.982906
        _DisplaceTex("DisplaceTex", 2D) = "white" {}
        _DisplaceSlider("DisplaceSlider", Float) = 0.02
    }
        SubShader{
            Tags {
                "RenderType" = "Opaque"
            }
            LOD 100
            Pass {
                Name "FORWARD"
                Tags {
                    "LightMode" = "ForwardBase"
                }
 
                CGPROGRAM
                #include "UnityCG.cginc"
 
                #pragma vertex vert
                #pragma fragment frag
                #pragma target 3.0
                #pragma multi_compile_particles
                #pragma multi_compile_fog
 
                uniform sampler2D _BaseTex;
                uniform float4 _BaseTex_ST;
                uniform float _Power_slider;
                uniform sampler2D _DisplaceTex;
                uniform float4 _DisplaceTex_ST;
                uniform float _DisplaceSlider;
                uniform float4 _TillingXYPannerXY;
 
                struct VertexInput {
                    float4 vertex : POSITION;
                    float2 texcoord0 : TEXCOORD0;
                    float4 vertexColor : COLOR;
                };
 
                struct VertexOutput {
                    float4 pos : SV_POSITION;
                    float2 uv0 : TEXCOORD0;
                    float4 vertexColor : COLOR;
                    UNITY_FOG_COORDS(1)
                };
 
                VertexOutput vert(VertexInput v) {
                    VertexOutput o = (VertexOutput)0;
                    o.uv0 = v.texcoord0;
                    o.vertexColor = v.vertexColor;
                    o.pos = UnityObjectToClipPos(v.vertex);
                    UNITY_TRANSFER_FOG(o,o.pos);
                    return o;
                }
 
                float4 frag(VertexOutput i) : COLOR {
                    float4 _DisplaceTex_var = tex2D(_DisplaceTex,  TRANSFORM_TEX(i.uv0,_DisplaceTex));
                    float2 node_9797 = ((((_DisplaceSlider*_DisplaceTex_var.r) + i.uv0)*_TillingXYPannerXY.rg) + _TillingXYPannerXY.ba*_Time.y);
                    float4 _BaseTex_var = tex2D(_BaseTex,TRANSFORM_TEX(node_9797, _BaseTex));
                    float3 emissive = (2.0*pow(_BaseTex_var.rgb,_Power_slider) + saturate(_BaseTex_var.rgb*1.2 - 0.2))*i.vertexColor.a;
                    fixed4 finalColor = fixed4(emissive,1);
                    UNITY_APPLY_FOG(i.fogCoord, finalColor);
                    return finalColor;
                }
                ENDCG
            }
        }
            FallBack "Diffuse"
}