Half Lambert: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(uncat)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Image:Alyx_lambert_half_lambert.jpg|right|200px|thumb|Alyx model showing Lambertian lighting (left) and Half Lambert lighting (right)]]
[[File:Alyx_lambert_half_lambert.jpg|right|200px|thumb|Alyx model showing Lambertian lighting (left) and Half Lambert lighting (right)]]
"Half Lambert" lighting is a technique first developed in the original [[Half-Life]]. It is designed to prevent the rear of an object losing it's shape and looking too flat. Half Lambert is a completely non-physical technique and gives a purely percieved visual enhancement and is an example of a forgiving lighting model.
'''Half Lambert lighting''' is a technique designed to prevent the rear of an object losing its shape and looking too flat.


== Implementation ==
Half Lambert is a completely non-physical technique{{clarify}} and gives a purely percieved visual enhancement and is an example of a forgiving lighting model.
[[Image:Lambert_vs_halflambert.png|right|200px|thumb|The Lambertian dot product lobe (red) vs. the Half Lambertian dot product lobe (blue)]]
To soften the diffuse contribution from local lights, the dot product from the [http://en.wikipedia.org/wiki/Lambert%27s_cosine_law Lambertian model] is scaled by ½, add ½ and squared. The result is that this dot product, which normally lies in the range of -1 to +1, is instead in the range of 0 to 1 and has a more pleasing falloff.


In the original [[Half-Life]], where this diffuse Half Lambert term was the only term in most of the model lighting, it kept the characters in particular from being lit exclusively by a constant ambient term on the back side with respect to a given light source.
== Games ==
{{stub|section=1}}
# {{hl|4}}


In [[Source]], Half Lambert lighting can most often be seen being used on the characters face materials. It is enabled by the use of <code>$halflambert</code> within a materials [[VMT]] file.
==Implementation==
[[File:Lambert vs halflambert.png|right|200px|thumb|The Lambertian dot product lobe (red) vs. the Half Lambertian dot product lobe (blue)]]
To soften the diffuse contribution from local lights, the dot product from the [[wikipedia:Lambert's cosine law|Lambertian model]] is scaled by ½, add ½ and squared. The result is that this dot product, which normally lies in the range of -1 to +1, is instead in the range of 0 to 1 and has a more pleasing falloff.


== See Also ==
In the original {{hl1|4.1}}, where this diffuse Half Lambert term was the only term in most of the model lighting, it kept the characters in particular from being lit exclusively by a constant ambient term on the back side with respect to a given light source.
* [[$halflambert]] - [[VMT]] shader paramter to enable Half Lambert lighting.
 
In {{src|4.1}}, Half Lambert lighting can most often be seen being used on the characters face materials. It is enabled by the use of {{mono|[[$halflambert]]}} within a material's [[VMT]] file, and is forced on when {{mono|[[$phong]]}} is used in most games.
 
==See also==
* [[$halflambert]] - [[VMT]] shader parameter to enable Half-Lambert lighting.
 
[[Category:GoldSrc]]
[[Category:Source]]


[[Category:Material System]]
[[Category:Material System]]
[[Category:Technical]]

Latest revision as of 11:38, 9 April 2025

Alyx model showing Lambertian lighting (left) and Half Lambert lighting (right)

Half Lambert lighting is a technique designed to prevent the rear of an object losing its shape and looking too flat.

Half Lambert is a completely non-physical technique[Clarify] and gives a purely percieved visual enhancement and is an example of a forgiving lighting model.

Games

Stub

This article or section is a stub. You can help by expanding it.

  1. Half-Life Half-Life

Implementation

The Lambertian dot product lobe (red) vs. the Half Lambertian dot product lobe (blue)

To soften the diffuse contribution from local lights, the dot product from the Lambertian model is scaled by ½, add ½ and squared. The result is that this dot product, which normally lies in the range of -1 to +1, is instead in the range of 0 to 1 and has a more pleasing falloff.

In the original Half-Life Half-Life, where this diffuse Half Lambert term was the only term in most of the model lighting, it kept the characters in particular from being lit exclusively by a constant ambient term on the back side with respect to a given light source.

In Source Source, Half Lambert lighting can most often be seen being used on the characters face materials. It is enabled by the use of $halflambert within a material's VMT file, and is forced on when $phong is used in most games.

See also