HLSL shader question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

HLSL shader question

Post by Luben »

Hi. I'm trying to make a per-pixel lighting shader.

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;
My problem is, where should i get the c_{Diffuse, Specular, Ambient, Emmisive} color values from?
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

You need to set them in the OnSetConstants callback. Check out the Shaders example for that.
Post Reply