Finding Light ents

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Finding Light ents

Post by Cobalt »

Doing some experimentation with QC and lights. Spike has indicated to me that some of the stuff I am looking to do means recompiling the map I am working with which is DM3.

I noticed the base type maps have alot of light_fluoro ents in addition to regular lights. The fluoro ents basicly have an origin, but other plain "light" sources include more field information than just origin. If I try to locate plain "light" using QC, for example , walking down the entire entity list - no "light" class type ents are found. We are able to locate the "light_fluoro" type lights however, and also apply new field information to them via QC, such as .effects etc.

Would the fluoro lights be considered "dynamic" lights, while the other "light" type ents be considered "static" ? I am vaguely aware of a "light" process while compiling a BSP and is this responsible for just the "static" type lights or basicly any kind of light ent? I am guessing that the "static light" is compiled as part of the BSP itself, and is why it cannot be changed. Would it be possible for an engine to re-render such a light with some code?
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Finding Light ents

Post by leileilol »

Static lights (without lightstyles or an ambientsound) are removed on spawn. They are still part of the entity list of a compiled Q1 BSP. Engines that support real-time world light work this way by reparsing the BSP to make lights out of them.

It's Q2 and Q3 that started discarding the light entities on compiling. The aforementioned real-time world light engines can't get the light ents out of those. It's even more trouble calculating lights out of radiosity surface lights as well.
i should not be here
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Finding Light ents

Post by Nahuel »

if you are using q3map2 (for q3bsp) in wolrd spawn you can add

Code: Select all

_keeplights 1
and the light entities will not be deleted
hi, I am nahuel, I love quake and qc.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Finding Light ents

Post by Spike »

light information is baked into the bsp as a pre-compile phase. the lighting is then completely divorced from the entities that originally generated that light.
switched lights do not change the entity that generated that light, but rather they change the style-string of that entity's lightstyle.
lights without a targetname can simply be removed inside their spawn function. many map compilers strip these lights out of the entity lump completely, as they're just wasted space.
Post Reply