Forum

Controlling Sunlight and Sunmangle from engine?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Controlling Sunlight and Sunmangle from engine?

Postby Stealth Kill » Sun Nov 30, 2008 6:52 pm

Hi

Are there any commands to control sunlight and sunmangle from engine?
I want to make a day & night function.
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby leileilol » Sun Nov 30, 2008 9:50 pm

How do you control a precompiled light variable?
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Downsider » Sun Nov 30, 2008 10:46 pm

leileilol wrote:How do you control a precompiled light variable?


Well that wasn't very clear of an answer if you don't really understand how the format works, but.. Yeah, unfortunately the shadows are baked into the map. Not very dynamic.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Stealth Kill » Sun Nov 30, 2008 11:44 pm

hmmmm

are there any other ways to make the map brighter or darker from engine?

r_fullbright makes the map bright
is it possible to change the brightness value of r_fullbright?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Downsider » Mon Dec 01, 2008 12:33 am

Stealth Kill wrote:hmmmm

are there any other ways to make the map brighter or darker from engine?

r_fullbright makes the map bright
is it possible to change the brightness value of r_fullbright?


Well it certainly wouldn't cast shadows correctly, and I'm not sure if it's built in, but adding that feature into the engine should be pretty simple, just adjust the contrast between shadows/lights, right?

Forgive me if I'm totally wrong.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Baker » Mon Dec 01, 2008 12:48 am

Stealth Kill wrote:hmmmm

are there any other ways to make the map brighter or darker from engine?


I don't claim to know exactly what r_ambient does, but it controls the lightlevel or something in DarkPlaces maybe?

I think I've heard ppl talk about the cvar to make DarkPlaces less dark.

/Add: it looks like it is similar to r_fullbright except it can do it less than absolute fullbright. The range is (0-128)
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby metlslime » Mon Dec 01, 2008 1:24 am

lightstyle 0 controls all the static lights in the map, this can be set by quakec just like any other lightstyle. That's how the screen pulsed to black when you kill shub.

No way to control sunlight direction, though.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby KrimZon » Mon Dec 01, 2008 4:51 pm

You could use different lightstyles for different lighting conditions (at its simplest, it could be day/night) and then change the levels of them to make a smooth transition between them. There'd be no way to change the sun direction without some heavy modification of the light program, but you could place lights to give the impression of the sun being in a particular direction. There's a limitation to the number of simultaneous lightstyles that can be used on a face though, iirc.
KrimZon
 
Posts: 11
Joined: Fri Nov 05, 2004 6:18 pm

Postby Spike » Mon Dec 01, 2008 8:46 pm

if its single player, you could make a trigger that turns off one light, turns on another, and centerprints "time passes" when they're inside somewhere.
but that's probably not practical.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby FrikaC » Mon Dec 01, 2008 8:53 pm

Bigmap had three lights, one on each opposite (west/east) horizon and one directly above and it blended the three of these using lightstyle, so basically what KrimZon said. It looked okay, but Bigmap was essentially all cube shapes, and that's what it looks best on.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest