Window lighting: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 18: Line 18:


[[File:windowtip4.png|right|thumb|The properties box.]]
[[File:windowtip4.png|right|thumb|The properties box.]]
4. Tie the brush to a {{ent|func_illusionary}} of {{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.) If using {{mono|func_brush}}, also set ''Solidity'' to ''Never Solid'' (unless you want the brush to simulate unbreakable glass).
4. Tie the brush to a {{ent|func_illusionary}} or {{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.) If using {{mono|func_brush}}, also set ''Solidity'' to ''Never Solid'' (unless you want the brush to simulate unbreakable glass).
{{note|Alternatively, use {{ent|func_null}}, to prevent wasting [[edict]]s.}}
{{note|Alternatively, use {{ent|func_null}}, to prevent wasting [[edict]]s.}}
{{clr}}
{{clr}}

Revision as of 06:17, 31 March 2025

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 lights/white001 or lights/white001_nochop. 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 well. The closer to zero, the brighter the light. If using the version without nochop, adjusting the "lightmap scale" will adjust the quality of the light.

The properties box.

4. Tie the brush to a func_illusionary or 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.) If using func_brush, also set Solidity to Never Solid (unless you want the brush to simulate unbreakable glass).

Note.pngNote:Alternatively, use func_null, to prevent wasting edicts.