Added new clouds shader

This commit is contained in:
raccoon
2025-05-16 15:54:39 +05:00
parent 1d9a961d9d
commit dd27a4a795
5 changed files with 185 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
Shader "Custom/CloudsShader"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_ScrollSpeed("Scroll Speed", Vector) = (0.1, 0.1, 0, 0)
_Color("Tint Color", Color) = (1,1,1,1)
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
Blend One One // Additive blending
ZWrite Off
Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _ScrollSpeed;
float4 _Color;
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
// Scroll UVs over time
float2 scroll = _ScrollSpeed.xy * _Time.y;
o.uv = v.uv + scroll;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
fixed4 tex = tex2D(_MainTex, i.uv) * _Color;
return tex;
}
ENDCG
}
}
FallBack "Unlit/Transparent"
}