
In my normal lighting shader I have this:
float3 l = normalize(IN.light.xyz - IN.oPosition); float3 v = normalize(IN.oPosition); // compute diffuse and specular terms float diff = saturate(dot(l,IN.normal)); float spec = saturate(dot(normalize(l-v),IN.normal)); spec = pow(spec, shine); // attenuation factor float att = saturate(dot(l, IN.normal)); // compute final color float3 finalcolor; finalcolor = ambient.xyz*color.xyz + att*(color.xyz*diffuse.xyz*diff + specular*spec); return float4(finalcolor.xyz, 1.0);
With no normal map or anything, how might I slot PC into this code. I'm thinking it would replace the view direction v that I have. Someone else told me the *= it with the final colour, but that just produces weird rainbow type colours, and my light is white