Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct fsOutput {
- float4 color : COLOR;
- };
- uniform sampler2D color_texture : TEXUNIT0;
- uniform sampler2D normal_texture : TEXUNIT1;
- fsOutput FS_Main(float2 colorCoords : TEXCOORD0,
- float2 normalCoords: TEXCOORD1)
- {
- fsOutput fragm;
- float4 anorm = tex2D(normal_texture, normalCoords);
- float3 normal = normalize(anorm.rgb * 2.0f - 1.0f);
- float3 light_pos = normalize(float3(1.0f, 1.0f, 1.5f));
- float diffuse = max(dot(normal, light_pos), 0.0);
- float3 color = diffuse * tex2D(color_texture, colorCoords).rgb;
- fragm.color = float4(1.0f,1.0f,1.0f,1.0f);
- return fragm;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement