Shader "Custom/15-1-Reflection"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Cube("Cubemap", CUBE) = "" {}
}
SubShader
{
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert noambient
struct Input
{
float2 uv_MainTex;
float3 worldRefl;
};
sampler2D _MainTex;
samplerCUBE _Cube;
void surf(Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
float4 re = texCUBE(_Cube, IN.worldRefl);
o.Albedo = c.rgb;
o.Emission = re.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
'Shader > Shader - SurfaceShader' 카테고리의 다른 글
16-2-1깊이버퍼 출력 (0) | 2020.04.08 |
---|---|
15-3-MaskMap (0) | 2020.04.08 |
14-5 (0) | 2020.04.06 |
13-4 rim (0) | 2020.04.06 |
13-3 Gloss (0) | 2020.04.05 |