SFM/Ambient Occlusion: Difference between revisions

From Valve Developer Community
< SFM
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 2: Line 2:


== About Ambient Occlusion ==
== About Ambient Occlusion ==
Valve's Source engine uses SSAO which stands for Screen Space Ambient Occlusion.
[[File:AmbientOcclusionExample.jpg|right|210px|thumb|An example of traditional ''prerendered'' ambient occlusion in Blender 3D. SSAO attempts to mimic this look in real-time.]]
In {{sfm|4}}, ambient occlusion uses [[SSAO]] which stands for '''Screen Space Ambient Occlusion'''. It works by examining an onscreen pixel then comparing its location in a [[Depth_buffer|depth buffer]] to the pixels around it. Pixels which are close together but not coplanar (on the same face) are shaded to simulate soft shadows. To maximize efficiency and speed, random sampling is used which will inevitably create noise/grain. This is avoided by blurring the SSAO pass.


== What Visual Difference Ambient Occlusion Makes ==
== What Visual Difference Ambient Occlusion Makes ==
The most significant affect of ambient occlusion is that geometry appears much more three-dimensional.<br>
The most significant affect of ambient occlusion is that geometry appears much more three-dimensional.<br>
Parts of a model which are meant to be shaded but aren't reached by dynamic shadows receive proper attenuation.<br>
Parts of a model which are meant to be shaded but aren't reached by dynamic shadows receive proper attenuation.<br>
Picture the roots of ambient occlusion as little points of shading. All these little points group together to form radial shadows. The settings such as bias, radius, and strength (explained [[#Enabling_Ambient_Occlusion|below]]) determine how each of those points work together to create realistic shadows in places of geometry where light would be occluded.<br>
Picture the roots of ambient occlusion as little points of shading. All these little points group together to form radial shadows. The settings such as bias, radius, and strength (explained [[#Camera_Settings|below]]) determine how each of those points work together to create realistic shadows in places of geometry where light would be occluded.<br>
Below are some examples of shading using ambient occlusion.
Below are some examples of shading using ambient occlusion.


Line 15: Line 16:


{{Note|If there's ugly black speckles frequenting the scene upon enabling AO, that is normal. All this means is that you are not looking through your scene camera with at least 8 samples of [[SFM/Progressive refinement|depth of field]] rendered in the [[SFM/The viewport|viewport]] (you must be in the [[SFM/The Clip Editor|Clip Editor]]).}}
{{Note|If there's ugly black speckles frequenting the scene upon enabling AO, that is normal. All this means is that you are not looking through your scene camera with at least 8 samples of [[SFM/Progressive refinement|depth of field]] rendered in the [[SFM/The viewport|viewport]] (you must be in the [[SFM/The Clip Editor|Clip Editor]]).}}
{{Note|Enabling ambient occlusion can slow down Source Filmmaker.}}


-Comparison picture:
[[File:Dof comparison.png|thumbnail|Comparison of different DOF sample rates]]
'''No DoF''' versus '''DoF at varying sample rates'''


== Camera Settings ==
== Camera Settings ==

Latest revision as of 23:17, 31 December 2024

Warning.pngWarning:This page is under construction and requires a lot more information before acting as an essential resource.

About Ambient Occlusion

An example of traditional prerendered ambient occlusion in Blender 3D. SSAO attempts to mimic this look in real-time.

In Source Filmmaker Source Filmmaker, ambient occlusion uses SSAO which stands for Screen Space Ambient Occlusion. It works by examining an onscreen pixel then comparing its location in a depth buffer to the pixels around it. Pixels which are close together but not coplanar (on the same face) are shaded to simulate soft shadows. To maximize efficiency and speed, random sampling is used which will inevitably create noise/grain. This is avoided by blurring the SSAO pass.

What Visual Difference Ambient Occlusion Makes

The most significant affect of ambient occlusion is that geometry appears much more three-dimensional.
Parts of a model which are meant to be shaded but aren't reached by dynamic shadows receive proper attenuation.
Picture the roots of ambient occlusion as little points of shading. All these little points group together to form radial shadows. The settings such as bias, radius, and strength (explained below) determine how each of those points work together to create realistic shadows in places of geometry where light would be occluded.
Below are some examples of shading using ambient occlusion.

Enabling Ambient Occlusion

Enabling Ambient Occlusion is as easy as right-clicking the viewport and heading to your render settings. In the dialog box for your render settings, check the box adjacent from the Ambient Occlusion setting which reads "enable". Make sure that the drop-down menu next to the AO setting reads "AO Only" and not "Outline(link) Only" or "AO & Outline" (edit for proof, add pictures).

Note.pngNote:If there's ugly black speckles frequenting the scene upon enabling AO, that is normal. All this means is that you are not looking through your scene camera with at least 8 samples of depth of field rendered in the viewport (you must be in the Clip Editor).
Note.pngNote:Enabling ambient occlusion can slow down Source Filmmaker.
Comparison of different DOF sample rates

Camera Settings

SSAO Bias: Determines the threshold for visible ambient occlusion
SSAO Strength: Determines the intensity of the shadows cast by ambient occlusion
SSAO Radius: Determines the filtersize (spread) of shadows cast by ambient occlusion

Tip.pngTip:In almost all situations, you will find that increasing your bias while restricting your radius will produce the most realistic ambient occlusion. In order to refine your AO to a precise level, go into your viewport render settings and check "Show AO". Your viewport will only show your ambient occlusion shading and you'll be able to know exactly where it's affecting your scene.