Question about engine lighting

I created a simple day/night editor using engine.LightStyle() and render.RedownloadAllLightmaps(), but i’m confused as to how map lighting as a whole works…

Garry added engine.LightStyle() and render.RedownloadAllLightmaps() a while ago. But what does this do in maps with multiple light sources? When a map is compiled, all map-based static light is precalculated using lightmaps. What is being changed, in terms of the map, its lighting, and all associated brushes, when engine.LightStyle is used? And should the function really be server-side? and what is going on in the client when render.RedownloadAllLightmaps() is used? I can assume that engine.LightStyle() only effects light associated with brushes / brush entities, so what can I do to affect model lighting? And then, how is model lighting really calculated opposed to brush lighting anyway?? How does the server send information about what needs to be rendered, using visleafs, to the client? Are the “server” and “client” really that detached in singleplayer? I’m not looking for answers to all these questions, just a simple explanation about how map lighting is calculated by the “engine” and what engine.LightStyle() is changing, in relation to the map and its engine-calculated lighting.

I spent the last several hours reading articles on everything from visleafs, to shaders, to map design, to client-server architecture on the valve developer site, and more questions keep coming up. If there’s someone with an advanced knowledge in how the source engine and maps work, please respond. Thanks!!

Baked lighting is actually a texture that is overlayed.

I’m not sure, but I believe non-static model lighting is calculated by some average of the surrounding lighting.

So “baked” lighting is lighting that affects brushes? And what determines “surrounding” lighting? How is it related to baked/engine lighting?

I’m not sure how it affects non-static props, it was just speculation.

Hopefully someone with more knowledge on the subject will chime in.

It’s envmap. get dark envmap texture and apply it to the texture.

The $envmap material parameter creates reflections on smooth surfaces by reflecting an environment map, usually an env_cubemap entity, and has nothing to do with lighting…