Post

How do non-static entities determine their light level in Goldscr? I understand that a lightmap texture is created during map compilation and applied to the surfaces of the world geometry. But how do things that are not necessarily standing on surfaces determine their light level? How does the player character in the video "know" that it's not in shadow while jumping?

gordonhappy1
Magic Nipples
Magic Nipples
Sep 19, 2023

While light_environment can change things slightly. All models in the game grab their light values from the floor that's beneath them. It doesn't matter how high above it they are it will always be the current light values on the ground level. Quake 1 and by extension Half-Life do not use a light grid so entities only have the ground as a reference point for lighting.

Ankkala
Ankkala
Sep 20, 2023

Thanks for the reply. As you can see in the video, the light level does appear to vary by elevation. If I move closer to the tower, I have to be much higher in order to not be in its shadow. (Unfortunately not able to share another video in the comments, but you can see it in these screenshots. All I did between them was "swim up" a little while in noclip mode.) The renderer appears to act _as if_ the shadow has a volume. Are you saying that the light emitted by the sky (light_environment) is a special case for the engine, and the same effect could not be replicated if I were to replace that sky with a big lamp?

Reply to Ankkala
Ankkala
Ankkala
Sep 20, 2023

I suppose it would be fairly straightforward to implement. The light_environment defines its angle, so you could just trace a path from any entity to the opposite direction and see if the first surface you hit has a SKY texture... but is this what's going on?

Reply to Ankkala
Magic Nipples
Magic Nipples
Sep 20, 2023

as I said. light_environments treat model light differently, but besides that, every other light is only floorlevel.