보통 C#코드로 짠걸 붙여 쓰지만 shader상에서 구현하는거 만든김에....
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_scrollX("U scroll input", float) = 1
_scrollY("V scroll input", float) = 1
}
SubShader {
Tags { "RenderType"="Opaque" }
Lighting off
LOD 200
CGPROGRAM
#pragma surface surf Unlit nolightmap nodirlightmap noforwardadd approxview halfasview noambient
sampler2D _MainTex;
float _scrollX;
float _scrollY;
fixed4 LightingUnlit (SurfaceOutput s, half3 lightDir, half atten) {
return fixed4(s.Albedo,1);
}
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, float2(IN.uv_MainTex.x + (_Time.x * _scrollX), IN.uv_MainTex.y + (_Time.y * _scrollY)));
o.Albedo = c.rgb ;
}
ENDCG
}
fallback "mobile/Diffuse"
}
'Technical Report > Unity Shader' 카테고리의 다른 글
Unity PostProcessing (0) | 2015.07.14 |
---|---|
Unity5 compressed option (0) | 2015.07.05 |
Terrain blend shader(Splatting textures By lerp) (0) | 2015.05.28 |
Surface shader UV atlas (0) | 2015.05.18 |
weed shader animation (0) | 2015.05.11 |