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 / DarkLights - Can it be used as a "dynamic lightmapper"?

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 11th Sep 2008 23:02
Hi! Has anyone played Thief: The Dark Project? That game uses what I call a "dynamic lightmap".

For example:
You start in a room (which obviously is lightmapped) and there is a torch. With your water arrow you can put out the fire to make the torch stop emitting light.
The lightmap in the room has now changed (or faded) into a lightmap without that particular light source.

What I am wondering is how to accomplish this with DBPro without shaders?
Would a possible solution be to use DarkLights and recalculate the lightmap for this area in-game? Or is this too slow?

The only time a lightmap would be recalculated would be when a torch or something similar (like a wall lamp) is put out or turned off/on.

What are your thoughts?

djchaos
18
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Brighton, UK
Posted: 11th Sep 2008 23:37
This is hard 2 explain, but on the lightmap image there are 2 versions of the same room, one with light one without. when the light goes out the lightmap texture just moves accross to a different frame on that same image. same as quake

as for lightmapping guns and other dynamic models there are 2 ways of accomplising this in DBPro, 1 is to make the level none responsive to light (but still have it lightmapped) and just add in lights and make the ambient light very dark, OR the better way is to calculate how far away the model is from the point light entity and adjust the model shade accordingly

Your mod has been erased by a signature
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 12th Sep 2008 02:35
I see. If that's how it is done in Thief then I can understand why you are able to put out lights without a frame rate drop.

I was thinking of adding three different lighting modes to have most people as possible play the game.

1)
To use lightmaps and dynamic lights combined.
When a torch is put out I don't really know how to update the lightmap (as in reference to this thread)

2)
To use lightmaps along with lightmap altering per pixel lights (Evolved has a shader for this I think).
Still the fact remains that I don't know how to update the lightmap when a light is put out.
In this setting you will also be able to "see" the dynamic lights; for instance a guard walking with a lantern will light up the lightmap.

3)
To use a soft shadow shader or something similar.
Which will probably drop the fps really bad. (I tried altering one of Evolved's shaders and it dropped from 980fps to 134fps with only one light )
Here I will probably have to go and learn hlsl shader programming aww..
But if I manage to get it working it will be spectacular (for those with pc's capable of running in this mode).

wh1sp3r
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 12th Sep 2008 11:22
Lukas W: what about GAMEFX commands for lightmaps ? perhaps, they are fast, dont know, or you can use Extends virtual lights, have you extends ? I am using darklights for creating dynamic lightmaps, but for terrain, which is dynamicly loaded. Main adventage of darklights is, that they are using another thread.


PS: Real programmers aren't afraid of math!.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 12th Sep 2008 17:17
What are the gamefx commands?

Yea I have Extends, so I will try that out too.

wh1sp3r
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 12th Sep 2008 17:18
Lukas W: gamefx are build in dbpro commands check help for 7.0b4 upgrade


PS: Real programmers aren't afraid of math!.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 12th Sep 2008 23:10
Thanks. I was still on beta 3 so that was why I didn't see this. I will take a closer look some time in the near future.

At the moment I am working on some player dynamics (movement, interaction and etc.) but graphics is just around the corner so I was just thinking ahead what would be a good idea to use to get that lightmap effect.

Login to post a reply

Server time is: 2025-06-28 05:41:14
Your offset time is: 2025-06-28 05:41:14