Bump map and camera.ambient question

Posted By: CBSection31

Bump map and camera.ambient question - 08/12/06 04:29

Hi everyone,

I'm new to the concept of shaders, so I apologize in advance if this question is basic and/or stupid.

I'm using a bumpmap effect from the AUM magazine (the code is below). I've noticed that adjusting the ambience of the engine via the camera.ambient command does not affect any blocks using the bumpmap effect. Is there any way around this? I've created a lightning-like effect using the ambient command, but only models show the changed ambience unless I turn off the bump mapping code.

Thanks in advance for your assistance!

The bump map effect, in an .FX file:

Code:
  		matrix matWorldViewProj; 
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
texture entSkin3;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <entSkin1>;
Texture[3] = <entSkin3>;
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;

magFilter[3]=Linear;
minFilter[3]=Linear;
mipFilter[3]=Linear;
COLOROP[3] = AddSigned;
COLORARG1[3] = Texture;
COLORARG2[3] = Current;
TexCoordIndex[3] = 1;
}
}



The game's code:
Code:

bmap cementDOT3 = <cementDOT3.tga>;
material cement
{
skin1 = cementDOT3;
flags = tangent;
}
starter load_shaders()
{
d3d_automaterial=1;
effect_load(cement,"bumpmap.fx");
wait(5);
}


Posted By: Lion_Ts

Re: Bump map and camera.ambient question - 08/12/06 21:15

I have no solution, but You can try to change "Modulate" to "Modulate2x", "...4x"... to change ambient color
Posted By: CBSection31

Re: Bump map and camera.ambient question - 08/13/06 20:40

Thank you for your reply. Modulate definitely does work, but is there a way to alter this in realtime during gameplay? The way I have it now, it is preset in the FX file. Thanks!
Posted By: Lion_Ts

Re: Bump map and camera.ambient question - 08/14/06 22:11

You can pass vars (overall brightness of the level, for example) to shaders or FFE with mtlskill... and do needed calculation in a shader code. But, I don't know, how to apply it to your FFE code, sorry.
Posted By: CBSection31

Re: Bump map and camera.ambient question - 08/15/06 17:51

Okay, I'll play around with the code and see what I can come up with. Thanks for your reply.
© 2023 lite-C Forums