Hi there guys,
I am trying to implement a bump map in C++ and i use the effect_load();
however it seems after this piece of code is executed, all objects in the scene have the fx applied.
why does it apply the shader to all the models in the scene? I want it only applied to one entity-material.
I use the bump straight from the wiki
Does anyone know what is going wrong here?
texture mtlSkin1; // the entity skin
texture mtlSkin2; // the bump map
float4 vecLight; // the light vector (assign it in action)
technique bump_dot3
{
pass P0
{
// set texture stage states
Texture[0] = <mtlSkin2>;
Texture[1] = <mtlSkin1>;
TextureFactor = <vecLight>;
ColorArg1[0] = Texture; // stage 0 = bumpmap
ColorOp[0] = DotProduct3;
ColorArg2[0] = TFactor;
ColorArg1[1] = Texture; // stage 1 - skin texture
ColorOp[1] = AddSigned;
ColorArg2[1] = Current;
ColorArg1[2] = Diffuse; // stage 2 - lighting
ColorOp[2] = Modulate2x;
ColorArg2[2] = Current;
}
}
Last edited by djamidin; 06/04/08 10:23.