Even lighting?

Discussion in 'Mapping Questions & Discussion' started by DrSquishy, Jun 27, 2017.

  1. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106
    In my map, I have quite a large interior of a building but have no idea how to light it gently yet evenly. Any help?
     
  2. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    753
    Positive Ratings:
    213
    Screenshots? Both in hammer and in game might help
     
  3. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106

    Attached Files:

  4. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106
    sorry if they aren't particularly good quality
    The ingame one shows basically the lighting for the whole warehouse interior
    And while we are at it, how can I fix the lighting bug on the displacement to the bottom left of the ingame image?
     
  5. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    You probably have unneeded displacements beneath your map. Destroy them
     
  6. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106
    thanks. Forgot the deleted displacement edges reverted due to the changed map version
     
  7. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    It's hard to see the in-game lighting of the interior of the building in that screenshot, since we only get a peek inside from a great distance.

    You don't appear to have any light point entities inside the building, so I presume you want it to be lit by environmental light only. I'll give you some suggestions based on that and then some suggestions for improving it with point light entities like light_spot.

    Using environmental light only
    Make sure the direction of light cast by your toolsskybox material, controlled by the light_environment, shines directly through your roof windows. You can adjust the sun spread angle value in your light_environment to soften shadows if the sky is grey, so they don't look unrealistically sharp. If it's too dark in there, turn up the brightness a bit.

    Lighter-coloured materials reflect more light
    When Source calculates lighting it calculates bouncing off material surfaces. A lighter material (like snow) will bounce off more light than a darker one, so if the interior of your building uses bright materials, more light will be bounced around. This is why there are a collection of dev textures with different percentages of reflectivity.

    If you're compiling in HDR
    You can adjust your map's exposure settings using an env_tonemap_controller. The 'min' value dictates the minimum level of illumination in your map, so setting it slightly higher will make your dark spots brighter. The 'max' value controls the upper brightness limit of your map. The game will increase the brightness when you go in to a dark place or look away from a bright light spot, and decrease it when you enter a bright place or look at a bright spot, like your eyes in real life. The 'rate' value controls the rate/speed that the adjustments between your min and max values are made.
    Please note that some people don't like playing in HDR so you'll want to make sure your map is evenly lit for HDR and non-HDR.

    Using light point entities to bring up ambient light
    The simplest way to improve the interior lighting is to create a grid of light_spot entities near the ceiling of your building. Place them something like 256 units apart. Adjust their inner and outer angles to something higher like 80 or 90 degrees (you can see a representation of these angles if you have 2D helpers enabled on the Hammer toolbar). Their default brightness of 200 is too low, so put it to something like 400-800. Adjust their colour to match that of your light_environment or something similar. Then compile and see how it looks. The aim should be to improve the lighting inside the building so that players can see, and can be seen, but to make it look natural. If a player gets close to a point light entity, the light source will be very obvious because it will glow brightly against the player, so try to keep players and light entities apart.

    Have actual lights inside there
    Buildings actually have lights inside them in real life, powered by electricity. You could look at the range of light props in the TF2 assets, place some in your map and put light_spot entities under them. You can also use low-brightness light entities to brighten places up (consider that light_spot only shines light where it looks, and not above, which is unrealistic since in real life, even spotlights can have some leakage, and they generally illuminate their fitments since they are actually ordinary globe bulbs or capsule lamps in a reflective housing). It's okay to use as many light point entities as you like, since they don't cost anything apart from lighting compile time.

    I built a sort of warehouse arena some time ago for a deathrun map and spent some time trying to light it evenly.

    [​IMG]

    What I ended up doing was having massive skylight windows with rows of light props, with light_spot underneath them. The cone-shaped props also have a light entity with a low brightness to illuminate the prop and ceiling above (you can see some unattached light entities toward the middle of the ceiling). Notice the very first light_spot entity in the foreground is about 128 units to the right of its associated prop. This is because I needed to better-illuminate the semi-enclosed area underneath. You can also see a dedicated angled low-brightness light_spot pointing at some iron steps. That was because the steps are func_detail and func_details can cause ugly black shadows.

    The end result was this:

    [​IMG]

    You can probably see from studying this image that lighting a large interior space with platforms and sub-ground routes is a challenging task and will turn out different to what you expected. I had to use light entities here and there to 'fake' light in dark spots, where player models were too dark. Open a decompiled copy of mvm_mannhattan and look inside the large warehouse to see what Valve did.
     
    • Thanks Thanks x 2
    • Like Like x 1
  8. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106
    Wow. At the moment I am playing with light_spots, changing them a little each time to try and get an effect like like streaming in through the windows.l, but they haven't been giving enough light. Thanks!
     
  9. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    No worries.

    light_spot do need a higher brightness value than other light entities. When I do lighting I try to think like there are two categories of light: ambient or indirect lighting, and direct lighting. Ambient/indirect is the general minimum illumination and colour of light you expect to see in each area (and ordinarily don't notice), that is contributed to by the ambient light setting of the light_environment and any 'fake' lights you employ. Direct lighting is light from the sun cast by the toolsskybox material controlled by the light_environment's main lighting value, and light entities used in a manner which makes them obvious, such as those coupled with prop lights. If you divide your lighting work in half, focusing first on ambient light and afterwards on direct light, it should be easier to understand and implement.

    It's difficult to emulate light streaming in through a window using light point entities because they don't radiate light in the same manner as the sun. The sun is technically also a point light in the sky but due to its size and distance, its rays are more or less parallel, which is why you get sharp shadows in sunlight. A point light entity is much smaller and closer than the sun, so its rays radiate around it in a circle and are angled from each other, casting softer shadows and less focused beams. You can attempt to compensate by increasing the intensity of the light but then you will probably get unwanted illumination elsewhere.

    If you placed a light_spot a long distance away from a roof window, in the sky pointing down and through it, narrowed its beam and increased its brightness you might get an acceptable result.

    Experimentation is a good idea when putting in lighting, but remember you won't see the full benefit if you do a fast VRAD/lighting compile since it calculates less bounces and has lower quality lightmaps (though the actual difference isn't large enough to cause you to get a false impression). Rather than make changes to one light and compile to check, try to work on multiple lights and then compile, so you spend more time adjusting and less time compiling. Try to do as much work as you can on a map before you compile it. This will help you be more productive.
     
  10. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    501
    Positive Ratings:
    106
    Thanks