From Valve Developer Community
Revision as of 22:44, 30 September 2016 by Glitchvid (talk | contribs) (Works on more than $eyerefract)

Jump to: navigation, search
Various WrinkleMaps maps found in Valve games for eyes and face.

Ambient occlusion is a shading method which helps add realism to local reflection models by taking into account attenuation of light due to occlusion [Clarify]. Unlike local methods like Phong shading, ambient occlusion is a global method, meaning the illumination at each point is a function of other geometry in the scene. However, it is a very crude approximation to full global illumination. The soft appearance achieved by ambient occlusion alone is similar to the way an object appears on an overcast day.

Note:Ambient Occlusion maps seem to be used exclusively for eyes and sometimes faces/heads.

Using Ambient Occlusion

Example VMT Syntax

The following example is taken from Left 4 Dead from the model material located in L4D root/materials/models/survivors/teenangst/teenangst_eyeball_l.vmt

$Iris "models/survivors/green_iris2" 
$AmbientOcclTexture "models/survivors/survivor_eye_ao" 
$Envmap "Engine/eye-reflection-cubemap-" 
$CorneaTexture "Engine/eye-cornea" 
$EyeballRadius "0.6" 
$AmbientOcclColor "[.4 .4 .4]" Default 0.33, 0.33, 0.33
$Dilation ".5" 
$ParallaxStrength "0.25" 
$CorneaBumpStrength ".5" 
$halflambert 1
$nodecal 1
$ambientocclusion 1

$RaytraceSphere 1 
$SphereTexkillCombo 0 

VMT Parameters

$AmbientOcclusion <bool>
Disable/Enable Ambient Occlusion. (1 = enabled, 0 = disabled)
Note:Used to toggle SSAO off/on for models in Source Film Maker.
$AmbientOcclColor "[.n .n .n]"
Replacing n with a number of the color (RGB format)
$AmbientOcclTexture "path/to/vtf"
Filename of the ambient occlusion texture to use

To do: How does $ambientocclusiontexture fit in with all of this?

See also