Fix lighting on a rotating object?

  • If you're asking a question make sure to set the thread type to be a question!

Data Boil

L1: Registered
Aug 23, 2016
7
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?
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
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.
 

henke37

aa
Sep 23, 2011
2,075
515
There is the option of using a dynamic light. I think they still work in tf2.
 
Mar 23, 2013
1,013
347
eventually adding a "minimum light level" could also look alright? Give it a value of .3 or so
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
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...
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
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.