Darkening the map in game

  • If you're asking a question make sure to set the thread type to be a question!

Snowbat

L4: Comfortable Member
Apr 23, 2013
165
74
Okay so I'm very satisfied of my nuclear detonation on my map. There's a flash, a bang and a mushroom cloud after the flash.
The only thing I'm trying to do now, is to darken the map after the explosion. At the moment, the detonation acivates a color_correction that makes the map look a bit more reddish and grayish but not darker.
I know it's impossible to change the light_environment settings mid-game so I think I'm gonna have to simulate darkening with color_correction? I just don't exactly know how in the ColorCorrectionUI I can achieve that effect.

Any suggestions?
 

Freyja

aa
Jul 31, 2009
2,994
5,813
I know it's impossible to change the light_environment settings mid-game

This is not true. You can switch light_environments in game. Light_environment is built off a light_spot entity which means it can be named (the targetname field just isn't in the fgd) can have the flag "Start Off" (the flag just isn't in the fgd) and can recieve the outputs TurnOff and TurnOn. You just can't fade between them, and it doubles the lightmap size of your map.

Just set up your two light envs and turn off smartedit to add the names, inputs and spawnflags.
 
Mar 23, 2013
1,013
347
Or use HDR lighting tonemap to darken the map. It will only be visible to people using HDR, but I assume most people do.

There are quite a lot fo people with fps configs which have hdr disabled.
I also disabled it because for some reason my game loads for 3 minutes when I swap from or HDR map to a LDR-only map or the other way around.

ANd also recmmend only naming your light_env if it covers only a minor part of the map since doubling the entire light map data is quite the file bloat :/
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
This is not true. You can switch light_environments in game. Light_environment is built off a light_spot entity which means it can be named (the targetname field just isn't in the fgd) can have the flag "Start Off" (the flag just isn't in the fgd) and can recieve the outputs TurnOff and TurnOn. You just can't fade between them, and it doubles the lightmap size of your map.

Just set up your two light envs and turn off smartedit to add the names, inputs and spawnflags.

would it not quadruple the size? Each one needs an on and an off state -> 00,01,10,11 four states
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
technically speaking you could have a logic auto: switch or timer, that switches the light sources
Initial + flash -(final) -> Initial +(flash) - Final

side note, your still gonna have to wire up the final env_light to use the grey colors and probably use a spread of 40, and a brightness of about 50-100.
 
Last edited:

tyler

aa
Sep 11, 2013
5,102
4,621
This kind of lighting effect isn't really practical to do in Source, especially TF2's old branch, which is why it's rarely seen.
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
This kind of lighting effect isn't really practical to do in Source, especially TF2's old branch, which is why it's rarely seen.

typically it works to a degree with the effect of lightning, which is possible with some basic light entities and a timer. So what I said above is possible, its just going to take time to wire and get working.