Change Skybox During Game

Muggie

L1: Registered
Mar 9, 2011
12
2
I was wondering if it was possible to change the skybox during a game without reloading the map or something, like after a round for a map with parts.

Example:
For a map like Dustbowl, each part would have a different skybox as if to simulate the sun setting with each new round. Dustbowl Part 1 would have bright sky, Part 2 would have an evening sky, and Part 3 would be night.

I would also like to know if you can change the lighting during it too to make it darker and lighter.

If it is possible, could someone explain how to do it or perhaps link me to a tutorial?

Thank you.
 

Psy

The Imp Queen
aa
Apr 9, 2008
1,706
1,491
The directional light will only use the settings from a single light_env so you cannot have multiple lighting settings like you want. As for the dynamic skybox, a work around would be to have a series of half-dome models in the 3D skybox as prop_dynamics. Then you would simple disable/enable them as you please.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
It is worth noting, that any of those methods for making a dynamic skybox will look like crap, because the sky-object will parallax and be lower res.
 

WBarton

L1: Registered
Aug 8, 2011
1
0
Hello. I've just recently begun looking into mapping and just joined here. I have a question about altering the skybox during play, and I spotted this post right off the bat and figured it would be a good place to ask. I was looking at an article about adding lightning to one's map, and I liked most of the ideas there, though I have some changes in mind. I'd like to make a night-time thunderstorm map at some point, and I don't think I'll have any trouble adapting the techniques I saw mentioned to my purposes (though I fear some of the changes I have in mind might make it too computationally expensive to render well on slower machines). This is the article I'm referring to, for reference:

http://developer.valvesoftware.com/wiki/Lightning

One thing I would like to add that I can't devise a technique to produce, however, is the way that flashes of lightning will light up parts of the sky, reflecting off of clouds and the like. The technique linked to above might suit my purposes, as the brief flashes and bright nature of the effect would likely make parallax a near non-issue, but with flashes of lightning occurring at different apparent distances and locations in the skybox, I'm afraid it would require more domes than I could feasibly place in the 3D skybox. If it were possible, I think it would be easier and more effective to somehow change the textures of the 2D skybox to simulate this effect. If anyone knows any way of doing this, I'd appreciate any input.

P.S. I made a note of the fact that parenting the lightning to a func_rotating will not work with TF2 and have devised what I think would be a viable workaround, just to preempt any comments about how that method won't work.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Valve handle lightning or similar lighting effects (portal storms) by using shaders on the player's screen, so the players screen flashes in a manner to HDR effects.

Anything else, such as physical changes to/in the environment, requires large amounts of light data. Not to mention is rather demanding on resource budgets. Flashing lights in Source tend to suck; they cause graphics tears and cause issue with lightmaps when a face has to share numerous lighting affects.

In short these specific effects (changing skyboxes from night to day or through seasons) are nearly impossible to produce and your best option is to try and execute some flashy screen based shaders client side for lightning. The trouble of course is that i'm not even sure if this is possible in TF2, i hear shaders are hard coded and thus there are very limited options available for quality screen effects (you'll probably be limited to a really tacky white fade in/out).
 
Last edited:

Wander

L3: Member
Sep 16, 2010
148
55
You can also use color corrections to fading the screen colours to make it look like the environment changes

Though color corrections can be switched off in settings, so you shouldnt use it in a way that people without color corrections have an advantage (like limiting visibility at night)