Mixing dynamic and precalculated lights

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
ebol666
Posts: 4
Joined: Sun Apr 23, 2006 12:16 am

Mixing dynamic and precalculated lights

Post by ebol666 »

Hi! :)

I was trying to do something like this: a test map, a room, lightmaped, 4 omni lights, one in each corner. The room is not complelty lighted, the center of the room is dark, and the corner areas are brighter.

Now, I want to add a dynamic light to the scene (the light radius doesnt cover all the room), but I want it to just light the scene... I cant explain it right :? I mean, when the dynamic light is in the one corner of the room this area is getting more lighted, but the rest stays the same.

Unfortunally I couldnt manage this, since the dynamic light makes the entire area that its out of its range darker.....

I hope one will understand what I ment to say by that :roll:

Anyway, whow can this be done? I worked with my3d file format... Any sugestions ?

cheers!
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post by TheC »

Could you get some screenshots of this?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use ambient light to make the world a little lighted. And use lighting affected lightmaps to get static and dynamic lighting.
ebol666
Posts: 4
Joined: Sun Apr 23, 2006 12:16 am

Post by ebol666 »

Thanks for the reply :) Actually I did what hybrid sugested before writting previous post, but I wasnt really happy with the results... Anyway, heres some screenshots:

This is a top view of a lightmaped model (no dynamic light):

Image

And this is with the dynamic red light placed in the midle of the view (white rectangle)

Image

Well, it doesnt look bad, the area that is out of the lights range stays the same, but same hapens with the center of the scene... Is stays dark, as it was without the dynamic light :( Only the bright areas seem to react, its a pity, since i was really looking forward to lightup the dark parts...

Is it even possible :?
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

additive lighting would be the solution since (lightmap=0)*(dynamiclight==1) still = 0

however 1 + 0 = 1

and if both are bright then the result is 2.

irr uses multiplicative lightmaps
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess that LIGHTMAP_ADD does not mean multiplication :idea:
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Thats adds the light map colour to the diffuse texture, i was talking about adding the dynamic lighting colour with the lightmap.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

So the solution would be a LIGHTMAP_ADD_LIGHTING? Since ADD would remove the 0 and lighting would add dynamic light.
Post Reply