How do the lights in Black Mesa work?

Yeah, I decompiled the BM maps and looked at the light entities, but why do they set the 50% and 0% distance variables to a certain number?

Also, they have odd combinations of values for the constant, quadratic, and linear variables. I was wondering how they would go about choosing appropriate values for those variables for the best lighting?

Thanks.

Experimentation, I’d imagine.
Also, BSP decompilation isn’t perfect.

It’s normally trial and error, would be my guess. It really depends on what the mapper wants to do with the light. I do think that Black Mesa’s lights are fantastic though, it’s clear they’ve refined their lighting and the methods they used for them an awful lot. As a mapper working on my own BM Projects myself, I’ve hardly ever deviated from emulating their style of lighting, because it’s just so good.

For example, to make a lightpost which illuminates a large area, it is a lot better to have a medium brightness light with a high constant ratio and a set 50% and 0% falloff distance, than the alternative. What most mappers do is they normally just make the light from something like a lightpost into a really bright light to make it illuminate a large area. The problem with this - particularly with the default 100% quadratic ratio, is that it’s very very bright where the light originates from, and drops off very quickly - which can look unnatural depending on the light.

Playing around with the c:l:q ratio and the 50%/0% falloff gives you great control over how the light falls off and can go a long way to making lighting looking more natural when you need it to. Though 100% quadratic looks alright, more customized ratios can look a lot better depending on what the mapper’s looking for.

Hope this has helped!

It has, it has.

However, how do you go about illuminating this large area with regards to linear and quadratic factors? When do you find it appropriate to make those two values bigger than the constant value or one another, etc.?

Also, I notice that the lights in Black Mesa are exceptionally bright and uhm… “realistic,” IMHO. Trying to take some of these lights to other Source games makes them look terrible.

How is that so? Is it the settings in the game?

Most probably the lightmap scales they use and the nature of their textures/environmental lighting. Some types of light look horrible if put in the wrong environmental light with a bad lightmap scale, but look amazing in the right environmental light.

Lighting isn’t just about the individual lights and their settings. It’s a culmination of the textures, colour schemes, mood, area design, etc etc. Taking a light from one area and putting it into another, totally different area, will often look really bad for this reason. I highly, highly doubt there’s anything special about Black Mesa or its version of the Source engine that makes it calculate lighting differently. They’ve just really refined their usage of lighting techniques to a fine art.

I see.

Also, the BMS team who did the blocklight textures on the grate somehow got them to work correctly. When I try to do it in my game, the walls start to have holes in them. It’s weird.

Map I’m referencing is BM_c1a4a.

https://developer.valvesoftware.com/wiki/Intermediate_Lighting
https://developer.valvesoftware.com/wiki/Advanced_Lighting
https://developer.valvesoftware.com/wiki/Constant-Linear-Quadratic_Falloff
https://developer.valvesoftware.com/wiki/Lighting

It’s all in the developer wiki.

My personal advice is to set up your light_spot entity in your world and play around with the color, brightness, C:L:Q values and Fall off distances.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.