Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bump map and camera.ambient question #85638
08/12/06 04:29
08/12/06 04:29
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
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);
}



Re: Bump map and camera.ambient question [Re: CBSection31] #85639
08/12/06 21:15
08/12/06 21:15
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
I have no solution, but You can try to change "Modulate" to "Modulate2x", "...4x"... to change ambient color

Re: Bump map and camera.ambient question [Re: Lion_Ts] #85640
08/13/06 20:40
08/13/06 20:40
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
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!

Re: Bump map and camera.ambient question [Re: CBSection31] #85641
08/14/06 22:11
08/14/06 22:11
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
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.

Re: Bump map and camera.ambient question [Re: Lion_Ts] #85642
08/15/06 17:51
08/15/06 17:51
Joined: Oct 2005
Posts: 131
C
CBSection31 Offline OP
Member
CBSection31  Offline OP
Member
C

Joined: Oct 2005
Posts: 131
Okay, I'll play around with the code and see what I can come up with. Thanks for your reply.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1