Fix lighting on a rotating object?

Discussion in 'Mapping Questions & Discussion' started by Data Boil, Jul 12, 2017.

  1. Data Boil

    Data Boil L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    I have a block in my map that rotates 180 degrees, but when it does, the new "top" shows as if it still has the shadow, and the new "bottom" behaves like a light is shining on it. Currently an environment light shines on the block.

    Here's an example I made to replicate it using a more complex structure. You can see it's light underneath that little ramp but dark every where else.

    I haven't the slightest idea as to why this could be happening. Any ideas?
     
  2. Idolon

    aa Idolon the worst admin

    Messages:
    1,550
    Positive Ratings:
    4,443
    This is because of how Source handles lighting. When you compile your map, Source will compute all of the lighting in one go and then bake it into all of the textures of the map, meaning lighting on most objects doesn't need to be computed in real time. Dynamic objects (like players, prop_dynamic, prop_physics, etc.) will still get real time lighting. Brush-based entities (like func_door, func_brush, etc.) get baked lighting, and so the lighting will tend to appear incorrect if they move a lot. Especially in this case.

    There's three things you can do (maybe more but I'm not aware of them):

    1) Turn it into a prop. There's some programs out there that can help you do this like Propper and VMF2SMD, but I've never actually done it myself so I can't help much further with that.

    2) Fake it by adding lights to the other side of the object so that underside of the object is about as bright as the top side of the object. You might also consider making the object a different texture from its surroundings so that your eye can't as easily tell when the object isn't quite lit correctly.

    3) Remove it because Source doesn't handle this stuff very well. This is a lame answer, but it's also the easiest one.
     
    • Thanks Thanks x 1
    • Agree Agree x 1
  3. henke37

    aa henke37

    Messages:
    1,912
    Positive Ratings:
    446
    There is the option of using a dynamic light. I think they still work in tf2.
     
  4. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    eventually adding a "minimum light level" could also look alright? Give it a value of .3 or so
     
  5. DrSquishy

    DrSquishy L8: Fancy Shmancy Member

    Messages:
    561
    Positive Ratings:
    134
    What about this light?:
    npc_spotlight
    A spotlight NPC, similar to point_spotlight but with the capability of tracking targets.
    I might have misunderstood the question though...
     
  6. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Really, there's no good way to do this without using a model. The good news is that there's no downside to using a model, aside from the added difficulty in creating one, and you don't really need to bother with it until your map has reached the detailing phase.