This question was
closed Mar 03, 2016 at 04:49 PM by
Bedini Claudio.
Question by
Bedini Claudio · Mar 01, 2016 at 04:13 PM ·
shadershaderslightshader programmingshader writing
Explain me this light-shader please
Please anyone can explain me the workings of the surf function and struct input please?
Shader "Example/Diffuse Texture" { Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType" = "Opaque" } CGPROGRAM #pragma surface surf Lambert
struct Input {
float2 uv_MainTex;
};
sampler2D _MainTex;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
}
Fallback "Diffuse"
}
Comment