Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Add realtime lighting for DP in my map? & spotlights

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
lth Joined: 11 Nov 2004 Posts: 129 |

Posted: Mon Jul 20, 2009 9:54 am Post subject: 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! _________________
randomviolence - tactical combat boardgame

Back to top |

reckless Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger |

Posted: Mon Jul 20, 2009 10:16 am Post subject: |

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

Back to top |

lth Joined: 11 Nov 2004 Posts: 129 |

Posted: Mon Jul 20, 2009 10:24 am Post subject: |

But can I add my rtlights in my level editor instead of having to apply them separately? If I can add spotlights, then how? _________________ randomviolence - tactical combat boardgame

Back to top |

reckless Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger |

Posted: Mon Jul 20, 2009 10:36 am Post subject: |

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.

Back to top |

lth Joined: 11 Nov 2004 Posts: 129 |

Posted: Mon Jul 20, 2009 9:04 pm Post subject: |

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 _________________ randomviolence - tactical combat boardgame

Back to top |

reckless Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger |

Posted: Mon Jul 20, 2009 10:48 pm Post subject: |

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.

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Mon Jul 20, 2009 11:29 pm Post subject: |

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.
_________________
What's a signature?

Back to top |

reckless Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger |

Posted: Tue Jul 21, 2009 10:21 pm Post subject: |

kudos. so it is possible but still better to check ingame beforehand with dp's editor. thx spike.

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> Engine Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group