Window lighting: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Kestrelguy moved page Window lighting to Window Lighting: title case.)
m (updated language bar. also some formatting.)
Line 1: Line 1:
{{otherlang2
{{lang|Window Lighting}}
|ru=Window_lighting:ru}}


By default, light will only shine in through a window if the [[light_environment]] angle is set so that sunlight shines directly through it. However, real-world windows will often stream in ''refracted'' (indirect) sunlight, independent of the suns angle.
By default, light will only shine in through a window if the {{ent|light_environment}} angle is set so that sunlight shines directly through it; however, real-world windows will often stream in ''refracted'' (indirect) sunlight, independent of the suns angle.


[[Valve]] commonly uses the following technique to simulate this:
[[Valve]] commonly uses the following technique to simulate this:
Line 11: Line 10:


[[Image:windowtip2.png|right|thumb|The brush-filled window.]]
[[Image:windowtip2.png|right|thumb|The brush-filled window.]]
2. Cover the opening with a brush using the ''nodraw'' texture.
2. Cover the opening with a brush using the <code>toolsnodraw</code> texture.
{{clr}}
{{clr}}


[[Image:windowtip3.png|right|thumb|The brush will now emit light.]]
[[Image:windowtip3.png|right|thumb|The brush will now emit light.]]
3. Texture the inward-facing side of this brush with the ''lights/white001_nochop'' texture. This particular texture emits light in-game. You can adjust the strength of this light with the "Texture scale" settings. Values between 0-1 work. Closer to zero, the brighter the light. (''Lightmap scale'' does nothing in this regard.)
3. Texture the inward-facing side of this brush with the <code>lights/white001_nochop</code> texture. This particular texture emits light in-game. You can adjust the strength of this light with the "Texture scale" settings. Values between 0-1 work. The closer to zero, the brighter the light. (''Lightmap scale'' does nothing in this regard.)
{{clr}}
{{clr}}


[[Image:windowtip4.png|right|thumb|The properties box.]]
[[Image:windowtip4.png|right|thumb|The properties box.]]
4. Tie the brush to a [[func_brush]] entity. In its properties, set ''Render Mode'' to ''Don't Render'' to will prevent the non-transparent brush from blocking the view as a white sheet. (It will still emit its light.) Unless you want the brush to simulate unbreakable glass, also set ''Solidity'' to ''Never Solid''.
4. Tie the brush to a {{ent|func_brush}} entity. In its properties, set ''Render Mode'' to ''Don't Render'' to will prevent the non-transparent brush from blocking the view as a white sheet. (It will still emit its light.) Unless you want the brush to simulate unbreakable glass, also set ''Solidity'' to ''Never Solid''.
{{note|Tying the brush to an non-rendered [[func_illusionary]] would work just as well, but this entity type has been deprecated.}}
{{note|Tying the brush to an non-rendered {{ent|func_illusionary}} would work just as well, but this entity type has been deprecated.}}
{{clr}}
{{clr}}


[[Category:Level Design]] [[Category:Tutorials]]
[[Category:Level Design]] [[Category:Tutorials]]
[[Category:Lighting]]
[[Category:Lighting]]

Revision as of 15:13, 2 May 2022

English (en)Русский (ru)Translate (Translate)

By default, light will only shine in through a window if the light_environment angle is set so that sunlight shines directly through it; however, real-world windows will often stream in refracted (indirect) sunlight, independent of the suns angle.

Valve commonly uses the following technique to simulate this:

A simple window with a frame.

1. Create the opening that you want light to refract through (such as a window).

The brush-filled window.

2. Cover the opening with a brush using the toolsnodraw texture.

The brush will now emit light.

3. Texture the inward-facing side of this brush with the lights/white001_nochop texture. This particular texture emits light in-game. You can adjust the strength of this light with the "Texture scale" settings. Values between 0-1 work. The closer to zero, the brighter the light. (Lightmap scale does nothing in this regard.)

The properties box.

4. Tie the brush to a func_brush entity. In its properties, set Render Mode to Don't Render to will prevent the non-transparent brush from blocking the view as a white sheet. (It will still emit its light.) Unless you want the brush to simulate unbreakable glass, also set Solidity to Never Solid.

Note.pngNote:Tying the brush to an non-rendered func_illusionary would work just as well, but this entity type has been deprecated.