Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Normal mapping stuffing up my lighting

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Apr 2010 08:42
Hi all, kinda new to this but I'm having a REALLY hard time finding the right tutorials for this kind of thing...

I've got a game level made up of several .3DS objects textured with JPG images with additional JPGs for the normal mapping. For now I have one single light in my scene with a limited range on it, and the ambient light is 0% and light 0 is hidden. So light 1 is the only source of light, and with a limited range it should mean that I can only see for a certain distance in the level...

Well, that works fine until I turn on the normal mapping using the SET NORMALIZATION ON, SET LIGHT MAPPING ON and SET OBJECT SPECULAR commands... As soon as I do that, the normal mapping all works perfectly, but the lighting goes bezerk. It's as if the entire level is FULLY illuminated and there are no shadows anywhere.

Quite bizarre...

I was wondering if anyone could please either explain why this happens or could point me towards a decent tutorial covering this sort of thing... I'm following the provided examples on normal mapping to the letter and for some reason they're not working for me... I know I'm missing something but I just can't get a conclusive answer as to what...

Thanks in advance! Let me know if you need more info.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Apr 2010 15:08
The light mapping command is for a statically lit, lightmapped object, NOT for lighting involving dynamic lights so of course it's going to make the object appear fullbright.

It's assuming you have a copy of the object ghosted with a light map texture applied to it. (Or it's a command to add the lightmap to the original object without using a separate object.) The SET LIGHT MAPPING ON command should disable the objects sensitivity to lights.

Oh and SET NORMALIZATION ON does not turn on normal mapping. All it does is recalculate the normals of the object. For normal mapping you will need a normal mapping shader or use blend mapping.

My signature is NOT a moderator plaything! Stop changing it!
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Apr 2010 16:12
Any suggestions on HOW to have a normal mapped object with lighting applied?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Apr 2010 18:28 Edited at: 28th Apr 2010 18:29
The SET BLEND MAPPING ON command.



You can check the help file for the command to get the other various settings for that last parameter, but these are the ones I've found to work the best for their indicated purposes. Some of the textures may require lightening or darkening to look right.

This will react to light.

OR

You can use a shader.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th Apr 2010 03:01
Interesting... I haven't played with that command set yet...

Thanks for the tip, KISTech! I'll have a play around with that and see how I go.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th Apr 2010 03:39
VERY cool. That worked a treat! Thanks for the tip, KISTech!

Login to post a reply

Server time is: 2026-07-26 04:28:04
Your offset time is: 2026-07-26 04:28:04