Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Erosion/Atmosphere"
- {
- Properties
- {
- _VaporField("Base (RGB)", 2D) = "white" {}
- _MaxVaporForBlackColor("MaxVaporForBlackColor", Float) = 0.1
- }
- SubShader
- {
- Tags { "RenderType" = "Opaque" }
- LOD 200
- CGPROGRAM
- #pragma exclude_renderers gles
- #pragma surface surf Lambert vertex:vert
- #pragma target 3.0
- #pragma glsl
- sampler2D _VaporField;
- uniform float _AtmoHeight, _ScaleY, _MaxVaporForBlackColor;
- struct Input
- {
- float2 uv_MainTex;
- };
- void vert(inout appdata_full v)
- {
- v.tangent = float4(1,0,0,1);
- v.vertex.y += _AtmoHeight * _ScaleY;
- }
- /*float3 FindNormal(float2 uv, float u)
- {
- float ht0 = GetTotalHeight(tex2D(_MainTex, uv + float2(-u, 0)));
- float ht1 = GetTotalHeight(tex2D(_MainTex, uv + float2(u, 0)));
- float ht2 = GetTotalHeight(tex2D(_MainTex, uv + float2(0, -u)));
- float ht3 = GetTotalHeight(tex2D(_MainTex, uv + float2(0, u)));
- float2 _step = float2(1.0, 0.0);
- float3 va = normalize(float3(_step.xy, ht1-ht0));
- float3 vb = normalize(float3(_step.yx, ht2-ht3));
- return cross(va,vb);
- }*/
- void surf(Input IN, inout SurfaceOutput o)
- {
- float vapor = tex2D(_VaporField, IN.uv_MainTex).x;
- //o.Albedo.r = clamp( vapor / _MaxVaporForBlackColor, 0.0, 1.0);
- o.Albedo.r = vapor / _MaxVaporForBlackColor;
- //o.Albedo.r = 1+ IN.uv_MainTex.x*100;
- o.Alpha = 1.0;
- //float3 n = FindNormal(IN.uv_MainTex, 1.0 / _TexSize);
- o.Normal = fixed3(0,0,0);
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement