Page 1 of 1

On/Off - Lights

Posted: Wed Apr 26, 2006 6:56 pm
by Silicone_Milk
Im wondering... how hard would it be to get a light switch working so you can turn off a light or turn it on?

I know that the game uses lightmaps to precalclate lighting but would it be possible to make a function that removes the lightmap coming from a light source to make the illusion of turning the light itself off?

I don't really have any reason why I'd want to turn a light off but I was just curious about it heh :smirk:

Posted: Wed Apr 26, 2006 7:34 pm
by Fjoggs
You can fake it with a shader, but that won't alter the lightmap, only fool your eye.
Lightstyles in q3map2 can make blinking lights, but tbh it looks out of place, and just hogs fps.

Posted: Fri Apr 28, 2006 4:22 am
by Silicone_Milk
Hmm... but would it be possible to rewrite the code to store each lightmap generated by every light source it's own bool switch or something to flip on and off?

Code for the switch would look something like

if switch is pressed && current lightmap is on
toggle lightmap off
else
toggle lightmap on

The switches would be associated with specific light sources in the editor so it knows what lights to toggle. Much like a button connects to doors to know which door(s) to trigger.

Again, only curious about the probability of getting something like that to work.

Posted: Fri Apr 28, 2006 4:53 am
by CheapAlert
it's called a new bsp format.

Posted: Fri Apr 28, 2006 5:16 am
by Silicone_Milk
Well I mostly assumed that. That wasnt the answer I was looking for really.

I dont even want to get into the whole bsp thing so Im going to just give this curiousity-driven adventure a miss.

Posted: Fri Apr 28, 2006 2:44 pm
by obsidian
It's really early in the morning and I have the flu so my brain may not be working yet... but would it be possible to use a triggerable shader entity and have it toggle between 2 shaders, one with a lightmap stage and one without?

Posted: Fri Apr 28, 2006 10:29 pm
by Silicone_Milk
That's what I was asking about actually but I suppose I really didn't make myself clear. When I was saying light source I was meaning any light emitting shader/model

Perhaps it would be possible with switching the shaders?

Posted: Sat Jan 20, 2007 10:19 am
by DonX
Interesting idea's here, but did anything become of this ? Can some body confirm whether switching between a light mapped shader and a non-light mapped shader works for changing the surface texture brightness ingame? *cough...in ( Q3 ) ?? :icon26:

.

Posted: Sat Jan 20, 2007 11:16 am
by Lukin
"Q3" has triggerable shaders? :o
Once upon a time I made a map where you could switch the lights on and off - I used simple trick with doors or plats that replace one wall with another. I can't find a link to that map... Will post later.

Posted: Sat Jan 20, 2007 11:30 am
by corsair
switching lights on and off is too oldskool really, I did it with alot with duke 3d 8D

Posted: Sat Jan 20, 2007 12:01 pm
by 4days

Posted: Sat Jan 20, 2007 12:48 pm
by Silicone_Milk
Whoa. It's alive :paranoid:

Nothing has ever became of this topic that I know of. I never looked into it any further than starting this thread.

I've started work converting the Q3 engine from C to C++ recently and I'm thinking about doing a major alteration to the code that would allow things like this to be added by modders "easilly".
But, I haven't given that much thought heh :icon26:

I'm just focusing on getting the code converted for now.

Posted: Sat Jan 20, 2007 1:52 pm
by dichtfux
corsair wrote:switching lights on and off is too oldskool really, I did it with alot with duke 3d 8D
Yeah, you could do it in DooM, too. Remember d2m4 - the focus? ;-)