HLSL shader question
Posted: Mon Mar 12, 2007 7:33 pm
Hi. I'm trying to make a per-pixel lighting shader.
My problem is, where should i get the c_{Diffuse, Specular, Ambient, Emmisive} color values from?
Code: Select all
float3 Diffuse=c_Diffuse*saturate(dot(Light, Normal));
float3 Specular=pow( saturate(dot(Half, Normal)) , SpecularPower) * c_Specular;
Return.xyz=c_LightColor * ( saturate(c_Ambient+Diffuse)*Color + Specular ) + c_Emmisive;
Return.w=1;