흔들리는 풀
Unity3D/Shader 2020. 12. 23. 16:08반응형
폴리브러쉬로 잎사귀만 칠하면 된다.
Shader "Custom/Leaves"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Lambert vertex:vert addshadow
void vert(inout appdata_full v){
//speed intensity
v.vertex.y += sin(_Time.y * 4.2) * v.color.r * 0.06;
}
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
float4 color : COLOR;
};
void surf (Input i, inout SurfaceOutput o)
{
fixed4 c = tex2D (_MainTex, i.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
반응형
'Unity3D > Shader' 카테고리의 다른 글
Refraction (0) | 2020.12.23 |
---|---|
Matcap (0) | 2020.12.23 |
Unity Unlit Shader (vertex & fragment shader) (0) | 2020.12.22 |
Diffuse Warping (0) | 2020.12.21 |
끊어지는 음영 (0) | 2020.12.21 |