Environmental lightning and the sun.

Unfocused

Companion Cube
Joined
Feb 22, 2004
Messages
6,459
Reaction score
52
It seems that no matter where I put the light_environment and env_sun, the map is lit from the same place and angle, and the sun appears in the same place. Why is that?
 
Dummies guide:

Add a huge box around your map using 6 brushes.

Texture it with "tools/toolskybox"

Go to - Map > Map Properties... > SkyBox Texture Name > type "sky_wasteland02" (or "sky_dust" for CS:S)

Click Apply.

Place an Entity ANYWHERE - press Alt+Enter - change the class to "light_environment"

Pitch Yaw Roll (Y Z X): 0 138 0
Pitch: -50
Brightness: 255 255 255 250
Ambient: 255 255 255 30

If it was the final compile obviously you wouldn't add the skybox around the entire map, but that's another thing altogether.
 
Okay, so I have to set the angle of the sunrays. But where does the light actually shine from? It should simulate something like the sun, but a sun IRL doesn't shine from the whole sky, but from one spot. How do I set the spot if it doesn't matter where I put the entity?
 
StardogChampion said:
Add a huge box around your map using 6 brushes.

...It's very, very, horribly, unspeakably bad to tell people to do this. It should never be done, and placing boxes around maps should never be spoken of again.

Even if it's a newbie, it's a BAD IDEA having them make a hollow cube around the map. Sky should always be made properly. Always.

Light_environment causes light to be cast from all sky brushes in the map in the direction of its pitch/yaw/roll with the color and intensity specified by the Brightness property. All areas of the map not directly lit by this sunlight are lit by sunlight that has bounced off of surfaces, and by the light_environment's Ambient light, which controls the color and intensity of light cast from all sky brushes in all directions. Essentially, it controls the color and brightness of shadows.

Env_sun doesn't emit light; it's just drawn on the sky either by drawing a ray from the viewer entity through the sun to determine where on the sky it should appear, or by specifying its angles if UseAngles is enabled.
 
The sun in games shines in a direction, not from one spot as such. All you're telling it is which direction to shine.

Press Alt+Enter on the light_environment, then you'll see a little black circle with a white line through it. This is the direction the sun will be shining in relation to the top-down view. Look in the top view then point the white line in the direction where you want the sun to shine.

So it shines from the opposite direction of where the white line is pointing.
 
Raeven0 said:
...It's very, very, horribly, unspeakably bad to tell people to do this. It should never be done, and placing boxes around maps should never be spoken of again.

Even if it's a newbie, it's a BAD IDEA having them make a hollow cube around the map. Sky should always be made properly. Always.
How do you suggest testing an unifinished outdoor map without putting a skybox around the entire thing? Honestly I add a huge skybox around unfinished outdoor maps all the time. There's no point building the skybox properly when you can test it quicker this way.

Also, if you read the end of my post, I did say...

EDIT: Oops, double post.
 
Raeven0 said:
...It's very, very, horribly, unspeakably bad to tell people to do this. It should never be done, and placing boxes around maps should never be spoken of again.

Even if it's a newbie, it's a BAD IDEA having them make a hollow cube around the map. Sky should always be made properly. Always.

Light_environment causes light to be cast from all sky brushes in the map in the direction of its pitch/yaw/roll with the color and intensity specified by the Brightness property. All areas of the map not directly lit by this sunlight are lit by sunlight that has bounced off of surfaces, and by the light_environment's Ambient light, which controls the color and intensity of light cast from all sky brushes in all directions. Essentially, it controls the color and brightness of shadows.

Env_sun doesn't emit light; it's just drawn on the sky either by drawing a ray from the viewer entity through the sun to determine where on the sky it should appear, or by specifying its angles if UseAngles is enabled.


So how am I supposed to make a skybox? It's quite logical that the sky should be visible around me and above me.
 
StardogChampion said:
How do you suggest testing an unifinished outdoor map without putting a skybox around the entire thing? Honestly I add a huge skybox around unfinished outdoor maps all the time. There's no point building the skybox properly when you can test it quicker this way.

Yet shortly after posting this, you posted a GIF of the best way sky can be made on unfinished maps. Not a hollow cube, but a cap. :P

Stinger, all that space on the underside will drastically increase the number of leaves and lightmaps that need to be calculated. Even if you just run BSP, the extra space and faces under there will add extra work for the BSP program.
 
Back
Top