Add realtime lighting for DP in my map? & spotlights
Moderator: InsideQC Admins
8 posts
• Page 1 of 1
Add realtime lighting for DP in my map? & spotlights
So, two questions:
1. How do I add realtime lights to my map for use with darkplaces?
2. Is it possible to make realtime spotlights for DP, ie. light projected from a specific point with limited angles?
Thanks!
1. How do I add realtime lights to my map for use with darkplaces?
2. Is it possible to make realtime spotlights for DP, ie. light projected from a specific point with limited angles?
Thanks!
-

lth - Posts: 144
- Joined: Thu Nov 11, 2004 1:15 pm
1: rtlights can be added from inside darkplaces (editor built in).
2: as far as i know yes ?.
rtlights are seperate scripts since quake maps dont have the nessesary
data structures for the lighting information. A bit like lit's for colored lighting but uses cubemaps and specular highlights for reflection/depth and point light.
lord havoc can probably fill you in on the specifics since im not a mapper
2: as far as i know yes ?.
rtlights are seperate scripts since quake maps dont have the nessesary
data structures for the lighting information. A bit like lit's for colored lighting but uses cubemaps and specular highlights for reflection/depth and point light.
lord havoc can probably fill you in on the specifics since im not a mapper
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
But can I add my rtlights in my level editor instead of having to apply them separately? If I can add spotlights, then how?
-

lth - Posts: 144
- Joined: Thu Nov 11, 2004 1:15 pm
not sure if it works from your level editor. rtlights where added years after quake was opensourced by lord havoc so im not sure if there are any editors capable of creating the scripts (i might be wrong since im not a mapper)
.
tenebrae was probably the first to add realtime lighting but the code was a mess and used entity scripting parsed from the maps with a console program which you then had to edit by hand. lord havoc added rtlights later and provided a built in editor to make the scripts from inside darkplaces so you could see the effect beforehand.
its as easy as loading your map in darkplaces then go into edit mode (sorry cant remember the command) and start plucking away at pointlights etc. untill satisfied
. save after and you're done. you will get some extra files in the map folder called *.rtlight those are the scripts holding the lights.
tenebrae was probably the first to add realtime lighting but the code was a mess and used entity scripting parsed from the maps with a console program which you then had to edit by hand. lord havoc added rtlights later and provided a built in editor to make the scripts from inside darkplaces so you could see the effect beforehand.
its as easy as loading your map in darkplaces then go into edit mode (sorry cant remember the command) and start plucking away at pointlights etc. untill satisfied
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
I'm really surprised that there's no proper tool support. I would have thought that it would be easy enough to encode rtlight information into regular 'light' entities 
-

lth - Posts: 144
- Joined: Thu Nov 11, 2004 1:15 pm
it could probably be added but would break protocol with regular quake engines my guess is thats the reason why there has been some hesitation to do it.
i.e it would create more problems since not all use the same engine of choice
.
this was a reasonable middleway so to speak.
if you dont care about compatibility i can provide some work i done on the last tenebrae2 engine which uses Quake 3 map format and uses shaders for realtime lighting (can be added with most good Q3 map editors) the engine is far from done though but if someone picks up where i left it i think it could reach a usefull state for a custom engine pretty fast as the things remaining to fix are quite small.
most notable buggers it still has are weapon poking into the walls
animated models (roq format) has no collision detection and shadows sometimes cut off to soon.
minor bugs in the menu system which uses xml (flickers a bit) but is mouse driven and works a bit like doom3's.
its pretty fast on modern hardware.
i can link a copy with sourcecode sdk and a miniversion of industry (tenebrae mod) so you can have a look at what its capable of.
i.e it would create more problems since not all use the same engine of choice
this was a reasonable middleway so to speak.
if you dont care about compatibility i can provide some work i done on the last tenebrae2 engine which uses Quake 3 map format and uses shaders for realtime lighting (can be added with most good Q3 map editors) the engine is far from done though but if someone picks up where i left it i think it could reach a usefull state for a custom engine pretty fast as the things remaining to fix are quite small.
most notable buggers it still has are weapon poking into the walls
animated models (roq format) has no collision detection and shadows sometimes cut off to soon.
minor bugs in the menu system which uses xml (flickers a bit) but is mouse driven and works a bit like doom3's.
its pretty fast on modern hardware.
i can link a copy with sourcecode sdk and a miniversion of industry (tenebrae mod) so you can have a look at what its capable of.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
You can do it from worldcraft/etc, yes.
Use the r_editlights_importlightentitiesfrommap command to import them from the BSP. And then use the relevent command to save them.
Cubemaps can be set on lights by using the skin field (skin must be greater than 16 or so).
So yes, it can be done outside the game.
But if you do so, you can easily add too many lights or whatever and cause the game to run at a crawl. Or not enough.
Use the r_editlights_importlightentitiesfrommap command to import them from the BSP. And then use the relevent command to save them.
Cubemaps can be set on lights by using the skin field (skin must be greater than 16 or so).
So yes, it can be done outside the game.
But if you do so, you can easily add too many lights or whatever and cause the game to run at a crawl. Or not enough.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest