$ambientocclusion: Difference between revisions
Jump to navigation
Jump to search
Note:Ambient Occlusion maps seem to be used exclusively for eyes and sometimes faces/heads.
Note:Used to toggle SSAO off/on for models in Source Film Maker.
Bug:When used on transparent materials (either $translucent or $alphatest, or all materials on a model where a transparent material has been used without compiling with either $Opaque or $MostlyOpaque in the QC file), $ambientocclusion also causes the material to render the effect for any objects behind the material. [todo tested in ?]
m (Works on more than $eyerefract) |
RagnarokEOTW (talk | contribs) ($AmbientOcclusion seems to be a float, not a boolean. Also, reported a common bug.) |
||
Line 34: | Line 34: | ||
=== VMT Parameters === | === VMT Parameters === | ||
;<code>$AmbientOcclusion < | ;<code>$AmbientOcclusion <float></code> | ||
: | : Controls strength of Ambient Occlusion. (1 = fully enabled, 0 = fully disabled) | ||
{{note|Used to toggle SSAO off/on for models in Source Film Maker.}} | {{note|Used to toggle SSAO off/on for models in Source Film Maker.}} | ||
;<code>$AmbientOcclColor "[.n .n .n]"</code> | ;<code>$AmbientOcclColor "[.n .n .n]"</code> | ||
Line 42: | Line 42: | ||
: Filename of the ambient occlusion texture to use | : Filename of the ambient occlusion texture to use | ||
{{TODO|How does <code>$ambientocclusiontexture</code> fit in with all of this?}} | {{TODO|How does <code>$ambientocclusiontexture</code> fit in with all of this?}} | ||
== Useful notes == | |||
{{Bug|When used on transparent materials (either [[$translucent]] or [[$alphatest]], or all materials on a model where a transparent material has been used without compiling with either $Opaque or $MostlyOpaque in the QC file), $ambientocclusion also causes the material to render the effect for any objects behind the material.}} | |||
''(Tested in Source Filmmaker)'' | |||
== See also == | == See also == |
Revision as of 15:24, 10 September 2017
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.

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
EyeRefract { $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 <float>
- Controls strength of Ambient Occlusion. (1 = fully enabled, 0 = fully disabled)

$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
Todo: How does
$ambientocclusiontexture
fit in with all of this?Useful notes

(Tested in Source Filmmaker)
See also
- Phong materials
- $phong
- $basetexture
- $envmapmask (specular mask)
- $envmap (environment map)
- $selfillum