Snarkpit Articles


Light from windows



You have an nice interior area of your map. You have a few opaque windows and you want to have them cast light into your map.



How can you achieve this? Its easy. You build a box at the angle you want the light to shine through your window and place it behind the window. It is best if you make the box the same size as the window.



Texture the whole box with nodraw, because this will never be seen by the player. You can now place a light spot in the far side of the box, or texture the back inside face with a lights/white texture.

If you were to compile the map now, you would not see the light because the "window" brush is blocking the light! To fix this you will turn the window into a func_brush and disable shadows.

Now your window will appear to cast light on the floor in the same shape of the window.

Cast more shadows



As you can see in the first picture the window frame is casting shadows. Obviously the texture isn't casting shadows. To achieve this you need to make use of the block light texture. Simply make small brushes with the block light texture on all faces and place it where you think the frame will go.

image

Note: you may want to turn the light grid down on the floor and walls around the window if you want hard shadows. The example picture uses 4 unit light map.


Post ReplyView Topic
Discussion
0 starsPosted by satchmo on Thu May 26th 2005 at 4:28pm

Nice tutorial. Concise yet detailed enough to be easily understood. The illustration is well done.
0 starsPosted by ReNo on Thu May 26th 2005 at 2:02pm

Well to be fair that is actually used to create a different effect. This tutorial explains how to get realistically shaped light spots from a window or other opening. The prop you are talking about is used to create visible "beams" of light. These two could easily be used together if the situation calls for it.
0 starsPosted by habboi on Thu May 26th 2005 at 1:29pm

Ah finally I see how you created this effect!
Thanks because now I won't have to use that static model in the effects folder.
0 starsPosted by ReNo on Thu May 26th 2005 at 12:43pm

Simple premise but not doubt something a lot of people have been wondering how to achieve. By the way, your windows don't need to be opaque to make use of this effect - you can quite happily build a skybox in the shape of your "light tunnel" and it will look normal in game while still giving this lighting effect.
Post ReplyView Topic