Shader "Custom/TestShader" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_BRDFTex ("BRDF (RGB)", 2D) = ""{}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf NoLighting
sampler2D _MainTex;
sampler2D _BRDFTex;
struct Input {
float2 uv_MainTex;
float2 uv_BRDFTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
fixed4 LightingNoLighting (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten){
half NdotL = dot(s.Normal, lightDir);
half NdotV = dot(s.Normal, viewDir);
half HalfNdotL = (NdotL*0.5f)+0.5f;
half4 c;
fixed4 ramp = tex2D (_BRDFTex,float2(NdotV,HalfNdotL));
c.rgb = s.Albedo * _LightColor0.rgb * ramp.rgb *( atten *2);
c.a = s.Alpha;
return c;
}
ENDCG
}
FallBack "Diffuse"
}
top of page
Sanphet Somjit
ค้นหา
bottom of page
Comentarios