Sharp light from windows
by
DrGlass (view all articles)
unrated

Create a beam of light from a window
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.
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.
Posted by
DrGlass on Mon May 30th 2005 at 10:32pm
True... you could just make a large box outside of the window, but if you had multible windows you'd need more than one box or the lighting wouldn't work.
Posted by
Leperous on Mon May 30th 2005 at 1:07pm
It's not hard: you put a light_spot behind your window, which is a func_brush, and you make extra brushes where the beams/bars are meant to be in the window using the BLOCKLIGHT texture (which will thus cause shadows to be cast properly on the floor). Of course, you don't need this angled NODRAW/SKYBOX box behind it- a square block will do just fine.
Posted by
DrGlass on Sun May 29th 2005 at 9:56am
Not quite sure what you mean, if you use just a spot light for the light-thru-window affect then you wont get the shape on the floor.
If you mean to use the rail to cast the shadow, that would work... BUT you have no controle over how the shadow will be cast and the block light can be made to fit the window style.
Posted by
Andrei on Sun May 29th 2005 at 9:48am
It's an interesting idea but i think i've got a better idea on how to do this: just put the spotlight inside the hall, right off the side of the window and place a func_illusionary rail wrapped in a texture with the rendernt 0 in the middle of tha hall, so that the light_spot shines on the it. You should obtain the same effect.
Posted by
DrGlass on Sun May 29th 2005 at 6:09am
Nodraw is a texture, you place it on a brush face that the play wont be able to see, so the engin doesn't draw the face and add to negative FPS (ever so slightly)
Posted by
XenNetwork on Sun May 29th 2005 at 1:17am
Ok its a little bit clearer now what you mean but whats it mean by nodraw, do i put a nodraw brush/texture?
Posted by
RabidMonkey777 on Fri May 27th 2005 at 11:17pm
It might be good to make the lightmap scale on nearby faces (floor for example) to 4 scale so the lines are sharper if you desire.
Otherwise, nice
Posted by
DrGlass on Fri May 27th 2005 at 6:45am
I"ll update the pic to make it more clear. You need to make a hole in your wall where you want your window to go, then place a 5 sided box against the hole in your wall. Then fill your hole with a func_brush, this will be your window. Hope this clears things up.
Posted by
XenNetwork on Fri May 27th 2005 at 3:48am
Your little example is sorta confusing like the func_brush part it looks like a whole bunch of dffrent brushes(hence all the white lines) and it dosent work for me either
Posted by
DrGlass on Thu May 26th 2005 at 11:00pm
ReNo is right Habboi, this is used to create a light shape one the floor, though you could also use dustmolts to help with a beam affect.