RTLights

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
sock
Posts: 137
Joined: Thu Aug 23, 2012 7:16 pm
Location: Wandering Around
Contact:

RTLights

Post by sock »

I have been experimenting with generating RTlight files for my mod to use in the darkplaces engines and I cannot find much documentation online to help me out. I was wondering if anyone here could give me some help or links to some documentation regarding the following questions:

1 ) Is there a way to store the extra rtlight parameters (radius, shadows, diffuse etc) on the light entities in the map file? So when I use the command r_editlights_importlightentitiesfrommap they are setup correctly and I don't have to tweak the lights via the r_editlights editor.

2 ) Can a light entity in a map file be setup to be excluded from the r_editlights import process? A specific key/field for example.

3 ) I see that rtlight files can be generated from .light or .ent files, what is the format for this files? Do they support the extra rtlight parameters?
Well he was evil, but he did build a lot of roads. - Gogglor
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: RTLights

Post by ceriux »

hey i think darkplaces can generate your lit files I think it has an in engine light editor. um as for built-in light via the entites. idk I know half-lifes bsp supports this. but im not sure about quakes. there may have been a compiler that did.

r_editlights 0 enables .rtlights file editing mode

http://icculus.org/twilight/darkplaces/readme.html
sock
Posts: 137
Joined: Thu Aug 23, 2012 7:16 pm
Location: Wandering Around
Contact:

Re: RTLights

Post by sock »

Yeah I have been experimenting with the inengine editor (r_editlights) but I was hoping there could be a way to connect the map file to the rtlights file so that light updates can be synchronized. Found a couple of interesting bugs while using the editor, I just wish there was an undo function for deleting lights!
Well he was evil, but he did build a lot of roads. - Gogglor
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: RTLights

Post by ceriux »

yeah sorry the only way i know how to have control over colored lighting directly in the map is using half-lifes bsp format. which is only supported on so many engines. i found these two threads with some information maybe.

http://www.quakeworld.nu/forum/topic/52 ... d-lighting

http://quakeone.com/forums/quake-help/s ... hting.html
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: RTLights

Post by goldenboy »

At this point, I'd just ask Lord Havoc.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Re: RTLights

Post by LordHavoc »

The r_editlights 1 editor supports all features, and has a number of convenience features like r_editlights_copyinfo and r_editlights_pasteinfo to let you easily replicate the same settings on multiple lights, it's designed for key binds...

But as for the entity import, full features were never implemented there, in contrast to tenebrae where full features are available from the entities alone, I meant to add a way to do this but never did.

You can achieve a lot of identical effects from the entities (after all, it is meant to mimic tyrlite / hmap2 -light, so controlling the light falloff with wait key and such can get great results) but some features are just not available, like the shadow setting and the corona settings and the cubemap skinning.

Many of these features can be accessed (at lower performance) on dynamic lights in the map using the pflags key to make a dynamic light, which is independent of the rtworld setting though.

The dynamic lights use Tenebrae-compatible dlight settings on an entity, and perhaps in future support for loading pflags light entities should be added to give the full feature set.
sock
Posts: 137
Joined: Thu Aug 23, 2012 7:16 pm
Location: Wandering Around
Contact:

Re: RTLights

Post by sock »

@ceriux, I am already generated colour light information (.lit file) from my map. I am using a light compiler with the code update from MH. The problem is I want to store the DP specific light information in the map file and that seems impossible at the moment.

@LordHavoc, at first I was entering the rtlight commands by hand via the console but that did not last long and I ended up re-defining most of my keyboard to quick access the rtlight commands. I find the copyinfo and pasteinfo commands extremely useful but they can destroy style light (switchable target lights) very easily. At first I did not know the style number was a unique thing for switchable lights (this really should be made obvious with special light icon) and in my first attempt of a rtlight file I often broke switchable lights.

My wish list for rtlights ...

* undo levels because it is easy to destroy a light setting with the copy/paste functions or even delete a light by mistake. There should be a quick undo function, several levels would be a bonus.
* Light profiles, most of my lights are based on types, a candle light is like every other candle light and it would be awesome if I could change every candle light in the map to the same parameters. Just like you can define a cubemap for a light, it should be possible to define a profile group. A master light that all other lights are linked too and take their settings. It would make editing rtlights a lot quicker.
* Storing rtlight settings on existing light entities. Maintaining two light files (map and rtlights) is a nightmare. They should be linked in some way. Sure it is awesome you can edit them in real time in the engine but the final result needs to be stored back in the map file. At the moment it is too easy to have them out of sync and unmanageable.
* Be able to create unique rtlights from special entities. I often want rtlight light entities that don't exactly mirror the map file light location. A new entity type would be awesome so I can create special rtlights and have them understoof by the mapimport process
* Exclude map lights from the import process. Having to delete a ton of lights after the map import process is time consuming when it would be easier just to define a key on the light that says, don't create a rtlight for this entity.
Well he was evil, but he did build a lot of roads. - Gogglor
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: RTLights

Post by Spike »

you could always make your own frik_file-based exporter to export an rtlights file based upon your choice of map entities, although.
however, frik_file isn't generally allowed to write to the intended path, so you'd need some batch script to copy files around... :s
alternatively you should be able to send r_editlight stuffcmds from the server to create lights according to your own vision of how map entities should become rtlights.
yes, this all needs work.

undo levels:
you can get an undo level by using the save/reload commands. :P

in fte, csqc code can directly edit various static rtlights - http://triptohell.info/moodles/csaddon/csaddon.dat is a gui editor for rtlights. I believe seven made some dp-specific alternative too, but I cannot say I've tried it.
I'd make an example mod to convert entities to rtlights in the csqc, but I'm too lazy - as you seem to consider dp only, it won't be useful to you anyway and you probably know dp's rtlight editing console commands better than me anyway. :P

edit: I spoke with lh. apparently dp's r_editlights command requires the user to point at them in order to edit all their properties, which means you cannot use stuffcmds from ssqc to generate your rtlights. you'll need to either make a fte+csqc mod (which uses the same .rtlights format), or frik_file with some sort of file-copy script (yuck).
Or you could make some external utility to read the fields and generate your rtlights file, which is the most straight forward choice...
Alternatively you can use TENEBRAE_GFX_DLIGHTS (this extension is the prefered choice if lights are attached to moving entities, but it of course works with non-moving ents too, but it is a little more limited in certain regards).
sock
Posts: 137
Joined: Thu Aug 23, 2012 7:16 pm
Location: Wandering Around
Contact:

Re: RTLights

Post by sock »

Ideally I would love the map importer part of r_editlights to be extended but I have no idea how that could be done or if anyone is working on DP anymore. Using save/load constantly is not really an undo function!?!

More wishes
* Being able to see the rtlight radius visually in the engine, could be setup as a toggle function and represented as a red sphere so it is easy to see what surfaces it affects. Also would be very handy for trying to minimize shadow lights overlapping.
Well he was evil, but he did build a lot of roads. - Gogglor
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: RTLights

Post by Nahuel »

hello sock, i write my rtlights files using a little modification of qc based in mouse scroll plus pressing some buttons. with this mod (easily implemented to any mod) is very easy to write rtlights files in maps, so you just need to press a button and scrolling your mouse to change the values ( all values; origin, angles, cubemaps, corona values, r, g ,b ambient, etc...) also you can spawn and delete lights with the mouse, and save files. this version is old (i didn´t write the "cubemap" stuff)

http://quakeone.com/forums/quake-mod-re ... laces.html
hi, I am nahuel, I love quake and qc.
sock
Posts: 137
Joined: Thu Aug 23, 2012 7:16 pm
Location: Wandering Around
Contact:

Re: RTLights

Post by sock »

@Nahuel, thanks for the link, I did not know you had done a mod for editing the rtlights, very cool idea. :)
Well he was evil, but he did build a lot of roads. - Gogglor
Post Reply