Light Textures

Discussion in 'Mapping Questions & Discussion' started by obsidiian, Oct 28, 2014.

  1. obsidiian

    obsidiian L1: Registered

    Messages:
    40
    Positive Ratings:
    5
    First off, the map I am working on is a jump map, not a regular map. I don't think my issue would come up in a normal size map, but because mine is a jump map, it's huge. Anyways, on to the issue...

    Long Version:
    I can compile my map with no problems. However, with a lightmap scale of 32 on all textures, I get a LDR leaf ambient of ~150%. This caused the map to go fullbright, which is obviously a problem. Raising the lightmap scale to 64 on all textures fixed this issue and brought LDR leaf ambient down to ~73% but made the shadows look really ugly. After a little while I came to the realization that my somewhat heavy use of light textures could be the issue. As of the time of posting, my map is 4/5 of the way done yet it's already pushing the lighting limits. Light textures are not exactly heavily used but they are definitely not rare throughout the map. I was told by a friend that light textures basically simulate a glowing texture by using tons of small lights a while ago, and I realized that this could be causing my problem. Basically what I would like to know is how the light textures work, whether or not they could be the issue, and if so, how should I go about finding a replacement texture?

    Short Version:
    I have light textures in my map and I think they're causing my map to hit 150% LDR leaf ambient with a lightmap scale of 32 on all textures. This forces the map into fullbright, basically ruining it. Bringing the scale up to 64 causes the LDR leaf ambient to fall to 73%. However, this causes ugly shadows. Are light textures my problem? If so, how can I fix them?

    Compile Log:
    The log posted is a compile with 64 lightmap scale.
     
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,532
    Every luxel (lightmap grid square) on a light-emitting texture generates the equivalent of an actual light entity at its center. You'll notice near the beginning of VRAD it says "1091 direct lights" which is your total actual light count including light entities and texlights. That's how they work.

    Assuming you have a negligible amount of light entities (lets go with 91 for ease), when you have everything at 32 lightmap scale you would end up with 4000 texlights. I've only ran into (different) problems having an extremely high density of texlights in one area (I was using 1 unit luxels). However, the LDR lightdata entry is the actual lightmap data, so I would be reasonably confident to say the leaf ambient is somehow related to light entities themselves, which are used for stuff such as lighting dynamic models (players, weapons).

    My suggestion, if your shadows are poor at 64, is to only make the texlight faces 64 and leave everything else (which will be receiving shadows) at 32. You can even get more specific than that if you like, lightmap optimzation can go a long way with huge maps. If you have really huge evenly lit faces (like outside, with nothing casting a shadow on them) you could get away with even 128 or 256 unit luxels.
     
  3. UKCS-Alias

    aa UKCS-Alias Mann vs Machine... or... Mapper vs Meta?

    Messages:
    1,264
    Positive Ratings:
    748
    On a side note to ABS. The skybox already does a similar effect. The scale on the textures there is 16, and everything is scaled up 16 times making it effectively 256 in size.

    Its the main reason why in some maps you can see the moment the skybox starts. Mappers that compensate for that make those skybox textures only with a scale of 1 which makes it effectively 16 again. That is the point where people again wont notice.

    The suggestion of ABS is probably best. If your light texture is very thin it wont give alot of lights:
    A 16x256 texture at a 16 scale can only give 34 (2x17). At 64x64 with again a scale of 16 this already changes to 81 (9x9). In that last case reducing its scale to 32 would make it effectively only 25 (5x5) and people wont notice it.

    Just devide the surface size by the scale and add 1. This gives the max number of lights that can be generated on 1 axis. And it also should help at deciding the problem giving textures.
     
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,532
    Took me a moment to figure out what you were trying to say with those numbers, which gave me a new point to mention: when you are going to the effort of considering lightmap scales on texlights, you should always be aligning the lightmap with the edges of the brush so you don't have excessive partial luxels.