Light_spot cone shape on wall

Discussion in 'Mapping Questions & Discussion' started by bamibal, Aug 19, 2015.

  1. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Would it be possible to make a spotlight throw a nice cone-shaped light parallel to the wall? Whatever I do it's always an ugly square. Or is this beyond the scope of TF2's abilities?

    [​IMG]
    (these are 2 light_spots, one upwards and one downwards)
     
  2. Idolon

    aa Idolon the worst admin

    Messages:
    1,536
    Positive Ratings:
    4,404
    You'll want to decrease the lightmap scale on that wall.

    When you compile your map, VRAD.exe will basically create light "images" for all of your brushes that get put on top of the base texture. However, they're also a low resolution by default. Making the lightmap scale value on a face lower will tell the engine to make a higher resolution lightmap for that face, which will allow you to get a nicer looking spotlight.

    You can read more about lightmaps here.
     
  3. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Thanks a lot! Still so much to learn. How low can I go with this number? At 2 it starts to look good although still jagged, but I guess that's going to be very bad for my compile times and map size?

    Could I get rid of the jagged edges?

    [​IMG]
     
  4. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,033
    Positive Ratings:
    3,980
    The better your lightmaps are, the larger your filesize is. And it adds up pretty fast. So only use it where you really need it and players will appreciate it. Not in random hallways, for instance.
     
  5. Idolon

    aa Idolon the worst admin

    Messages:
    1,536
    Positive Ratings:
    4,404
    Also, things start to break with low numbers. VBSP will puke if you put an overlay on a face with lightmap density 1. I think I remember reading that 4 is the lowest you should ever go, though I don't have the source for that handy.
     
  6. hutty

    aa hutty

    Messages:
    471
    Positive Ratings:
    372
    if jaggies are really that much of a problem, perhaps faking it with a glowing overlay would be a better solution.
     
  7. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Except that doesn't help much if you want it to actually light up the area. That wouldn't even project light onto the floor and ceiling.
     
  8. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Think I will settle with this, 4 units/luxel. Now let's hope it doesn't break my map:)
    Thanks for the help guys!

    [​IMG]
     
    • Thanks Thanks x 2
  9. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,742
    Which is why you combine it with a fake light entity to light the room and do the heavy lifting in the wall, while the overlay does the fine details on the wall
     
  10. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Here are some things to remember:

    • The closer you place a light_spot entity to a brush face, the 'harder' the 'edges' of the cone will be, and the more jagged they will look. If you move them away, their cone edges will be softer but you will have less control over the shape of the cone and the pattern of brightness.
    • When a cone hits a dark wall, the contrast between the dark surface and the light cone's edges can exaggerate the jagged effects. You can improve the look by including more light entities in the area to brighten up the wall, so that the jaggedness becomes less noticeable.
    • The light thrown out by bulbs in those light fixtures probably don't look like that in real life. You can afford to be a little messy.

    If you want to simulate an attractive cone effect, without increasing the lightmap resolution so much, and you don't mind so much what the shape looks like, then you can move the light_spot entity a bit further away from the prop, in a 45-degree direction. And as YM says, put in a 'phantom'/fake light entity near the prop to simulate the brightness of the bulb.

    [​IMG]

    This wall has a lightmap resolution of 16 luxels (default).
    [​IMG]

    This wall has a lightmap resolution of 8 luxels. Notice the smoothness of the cone's edges.
    [​IMG]

    In the screenshots I used a point_spotlight entity above and below the prop to simulate the point of light that is the bulb.
     
    • Thanks Thanks x 7
  11. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Looks pretty darn good worMatty, gonna try it. Thanks!
     
  12. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,033
    Positive Ratings:
    3,980
    Putting the light cones in the opposite direction farther away is something I wouldn't have thought of. I'm impressed.
     
  13. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,742
    A solution best done further away from where players can walk, since they'll get a stupidly bright spot as they walk through the light entities. The lightmap looks great, but the dynamic prop lighting will look very weird near that setup.

    Just something to keep in mind as you're putting light entities in crazy wild spots to get beautiful lightmaps
     
    • Thanks Thanks x 4