Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
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
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Normal Mapping Ambient #102464
12/17/06 22:49
12/17/06 22:49
Joined: Apr 2006
Posts: 8
T
tyleestuff Offline OP
Newbie
tyleestuff  Offline OP
Newbie
T

Joined: Apr 2006
Posts: 8
Hi, I am using the normal mapping shader from the tutorial listed on Acknex Unlimited called "Intro to Shader Programming". I made a normal map for my model and it looks just like the one from the example model and the normal mapping works. Currently I am using the templates for movement. Everything works like its supposed to except that the models are very dark. The only way I can see the skins well is if I fire a gunshot around them (muzzleflash light). I have tried putting lights near the models, and lights with their "dynamic" checkbox checked in WED. I have also tried to edit the ambient values in the material, but hey do nothing either. Can somebody please help me figure out how to make my models look normal? Thanks.
PS If i can i will upload a screenshot of what it looks like right now.

Re: Normal Mapping Ambient [Re: tyleestuff] #102465
01/26/07 04:15
01/26/07 04:15
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
I'm of no help, but here to let you know I'm in relatively the same boat and trying different things. I used a shader of the wiki (don't recall where), but behaves as you described. I'll use the one from the shader tut and I'll compare notes.

Re: Normal Mapping Ambient [Re: 3Dski] #102466
01/26/07 04:24
01/26/07 04:24
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
A quick and dirty fix not to the shader, but to get some more light is to temporarily make a dynamic light available, one that has an action assigned to it (not just checkboxed). You could add a temporary model to your level that use the Torch/Flashlight action found in this Thread
edit: or, you could just place a model in your level and assign the free dynamic light action from the action pack found at the DynaLights link below.
This would get some more light at least to your geometry if the environment is too dark.
cheers,
tindust

Last edited by tindust; 01/26/07 06:04.

Lighten Your Load With

DynaLights 1.0

Realtime 3D Lighting. Free Trial Version available.

3DGS 660P
Re: Normal Mapping Ambient [Re: tyleestuff] #102467
01/26/07 05:06
01/26/07 05:06
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
tyleestuff, I didn't use the model from the tutorial, rather a cube with my own color texture and normal map texture. Depending on the players orientation to the cube, parts of it are quite bright. In general, though, it is like you say... this is a little further than I prevously got My normal map was not very good, so I might correct it and try again tomorrow. Maybe there's a hint in the discussion of the tutorial shader that might point to something that can be changed or removed.

Re: Normal Mapping Ambient [Re: 3Dski] #102468
01/26/07 07:07
01/26/07 07:07
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
i think I had read before this is due to the nomal mapping only being affected by the suns light rather than by the dynamic lights in the level. This was some time ago though , dont know if it has been fixed in the recent updates , but prolly not.

Re: Normal Mapping Ambient [Re: Why_Do_I_Die] #102469
01/26/07 13:39
01/26/07 13:39
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Post the code, and I'll add ambience to the shader. IT's an HLSL shader that simply needs to add:

Code:

float Ambience = 50; // 0 - 100
...
Color += Ambience / 100;
Return(Color);




xXxGuitar511
- Programmer
Re: Normal Mapping Ambient [Re: xXxGuitar511] #102470
01/26/07 19:56
01/26/07 19:56
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:


Post the code, and I'll add ambience to the shader. IT's an HLSL shader that simply needs to add:
Code:
  
float Ambience = 50; // 0 - 100...
Color += Ambience / 100;
Return(Color);






Normally the "Intro to Shader Programming" tutorial form Taco has got an ambience parameter included But I don't think only ambient lighing will be enough here. Try adding diffuse lighting as well if you haven't. Important if you use Taco's normal mapping code is that you set the vecSunDir. All this must be included here because the diffuse and the normal mapping code from Taco's tutorial is calculated thru the predefined varable vecSunDir to first let the compiler now the direction of the sun to create the shadows and sec. to create the effect of detail illusion. Hope you got all of this, quite important to get the theory behind it and to use the code at a correct way.
Btw, if you already have done this, you might have forgot to include sun in your script like Taco did with his.

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Normal Mapping Ambient [Re: frazzle] #102471
01/26/07 20:25
01/26/07 20:25
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Fun to see people are reading my tutorial

The relevant piece of code from the shader is:
float4 Ambient = AmbientIntensity * vecAmbient;

As you can see, a vector with the ambient color is multiplied with a scalar value AmbientIntensity.
-AmbientIntensity is defined at the top of the shader, under "Tweakables". Make sure it is high enough (set it to 1 for just using the materials' ambient value)
-vecAmbient is automatically set by the engine, to the ambient color of the material. I'm guessing you didn't define the color in the material, in which case they are set to 0. Here is the material definition (c-script) from the demo:
Code:

material MtlNormalMapped
{
ambient_red = 64; // The ambient color.
ambient_green = 64;
ambient_blue = 64;
flags = tangent;
effect = "NormalMapped.fx"; // The effect file containing the vertex shader, pixel shader and technique.
}



If you have set both the AmbientIntensity and the material ambient to the values as shown in the tutorial, the model shouldn't be dark. If it is, please post your code and I'll take a look at it.

BTW, the shaders from my tutorial don't react to dynamic lights (only the sun). If you want to implement dynamic lights, take a look at "vecLightPos" in the manual.

EDIT: I just saw you said that you can see the skins if you fire a gunshot around them. That's strange, because the shaders don't react to dynamic lights. So I'm guessing you have forgot to apply the material with the shader to your model. See the chapter on including the shaders with A6 to see how that should be done. If it's the models that you don't want to use the shaders with that are too dark, just set the entity.ambient_red, green and blue to higher values and/or set the camera.ambient higher (note that the shaders don't react to the view.ambient, only the entities with no shader applied).

Last edited by Excessus; 01/26/07 20:36.
Re: Normal Mapping Ambient [Re: Excessus] #102472
01/26/07 22:20
01/26/07 22:20
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:


Fun to see people are reading my tutorial





Why shoudn't we ?? I mean it's a great tutorial, it has explained much to me until now so thxn again, you won that contest for a
reason

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Normal Mapping Ambient [Re: frazzle] #102473
01/26/07 22:23
01/26/07 22:23
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
'Tis what got me started with HLSL...


xXxGuitar511
- Programmer
Page 1 of 2 1 2

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