-
05/03 유니티 쉐이더 UV가 Time으로 흘러가게 하기유니티/쉐이더 2021. 5. 3. 16:53728x90
Shader "Custom/Test" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _UV("uv value", Range(-1, 1)) = 0 _USpeed("Uspeed", Range(-2, 2)) = 0 _VSpeed("Vspeed", Range(-2, 2)) = 0 } SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM #pragma surface surf Standard fullforwardshadows sampler2D _MainTex; struct Input { float2 uv_MainTex; }; float _UV; float _USpeed; float _VSpeed; void surf (Input IN, inout SurfaceOutputStandard o) { float4 c = tex2D(_MainTex, float2(IN.uv_MainTex.x + _Time.y * _USpeed, IN.uv_MainTex.y + _Time.y * _VSpeed)); //float4 c = tex2D(_MainTex, IN.uv_MainTex + _UV); o.Emission = c.rgb; } ENDCG } FallBack "Diffuse" }
728x90'유니티 > 쉐이더' 카테고리의 다른 글
05/04 유니티 쉐이더 Smoothness 연습 (0) 2021.05.04 05/03 유니티 쉐이더 불 타는 효과 만들기 (0) 2021.05.03 05/03 유니티 쉐이더 Texture 2장으로 lerp메서드 연습 (0) 2021.05.03 05/03 유니티 쉐이더 스피어 rgb 값을 슬라이더로 조절하기 (0) 2021.05.03 05/03 유니티 쉐이더 Sphere에 색 적용하기 (0) 2021.05.03