Half Lambert: Difference between revisions
m (removed inappropriate / irrelevant advertising) |
mNo edit summary |
||
Line 1: | Line 1: | ||
[[Image:Alyx_lambert_half_lambert.jpg|right|200px|thumb|Alyx model showing Lambertian lighting (left) and Half Lambert lighting (right)]] | [[Image: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 | "Half Lambert" lighting is a technique first developed in the original ''[[Half-Life]]''. It is designed to prevent the rear of an object losing its 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. | ||
== Implementation == | ==Implementation== | ||
[[Image: | [[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 [ | 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. | ||
In the original | 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. | ||
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 | 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 material's [[VMT]] file. | ||
== See Also == | ==See Also== | ||
* [[$halflambert]] - [[VMT]] shader | * [[$halflambert]] - [[VMT]] shader parameter to enable Half-Lambert lighting. | ||
[[Category:Material System]] | [[Category:Material System]] | ||
[[Category:Technical]] | [[Category:Technical]] |
Revision as of 23:51, 1 July 2017
"Half Lambert" lighting is a technique first developed in the original Half-Life. It is designed to prevent the rear of an object losing its 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.
Implementation
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, 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, 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.
See Also
- $halflambert - VMT shader parameter to enable Half-Lambert lighting.