On/Off - Lights

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

On/Off - Lights

Post 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:
Fjoggs
Posts: 2555
Joined: Fri May 03, 2002 7:00 am

Post 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.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
CheapAlert
Posts: 448
Joined: Tue Mar 19, 2002 8:00 am

Post by CheapAlert »

it's called a new bsp format.
Leader and director of the [url=http://cheapy.deathmask.net]OpenArena[/url] project which is a free software version of q3a designed for hobo fagts
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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?
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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?
DonX
Posts: 22
Joined: Tue Sep 26, 2006 5:16 am

Post 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:

.
Lukin
Posts: 349
Joined: Sat Jan 29, 2000 8:00 am

Post 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.
[size=75][url=http://www.lukinonline.com]lukinonline.com[/url][/size]
corsair
Posts: 972
Joined: Fri May 18, 2001 7:00 am

Post by corsair »

switching lights on and off is too oldskool really, I did it with alot with duke 3d 8D
4days
Posts: 5465
Joined: Tue Apr 16, 2002 7:00 am

Post by 4days »

Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
dichtfux
Posts: 571
Joined: Thu Feb 02, 2006 10:51 pm

Post 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? ;-)
[color=#FFFFFF][url=http://maps.rcmd.org]my FPS maps[/url][/color]
Post Reply