Click or drag to resize
AB4D logo

ScreenSpaceAmbientOcclusionRenderingProvider Class

ScreenSpaceAmbientOcclusionRenderingProvider provides support for using ambient occlusion to dim the ambient light on areas where it would be occluded by 3D objects. The class implements Screen Space Ambient Occlusion (SSAO) that provides a fast real-time rendering approximation of ambient occlusion. Note that SSAO does not work for PBR (Physically Based Rendering) materials because there usually a pre-calculated ambient occlusion texture is used. Also IShadowCastingNode and IShadowReceivingNode does not work with SSAO.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXDisposableDXResource
      Ab3d.DirectXDXSceneResource
        Ab3d.DirectXShadowRenderingProviderBase
          Ab3d.DirectXScreenSpaceAmbientOcclusionRenderingProvider

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax
C#
public class ScreenSpaceAmbientOcclusionRenderingProvider : ShadowRenderingProviderBase

The ScreenSpaceAmbientOcclusionRenderingProvider type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyChangeRenderTargetFromSsaoRenderingStep Gets a ChangeBackBufferRenderingStep that changes render targets from SSAO rendering to rendering 3D scene.
Public propertyCurrentShadowTextureSize Gets the Size2 that represents the current SSAO texture size.
Public propertyIsShadowTextureSizePercent Gets or sets a Boolean that defines if ShadowTextureWidth and ShadowTextureHeight are defined in relative value (by default). In this case the size of the texture is calculated by multiplying ShadowTextureWidth and ShadowTextureHeight with DXScene's Width and Height. When IsShadowTextureSizePercent is false, then ShadowTextureWidth and ShadowTextureHeight define the absolute size of the texture.
Public propertyNormalDepthEffect Gets or sets the NormalDepthEffect that is used to render the depth-normal texture of the 3D scene. This property is defined in this CreateResources(DXScene) method and can be overriden by the user.
Public propertyNormalDepthShaderResourceView Gets the ShaderResourceView that has a texture with 3D scene rendered as normal-depth texture.. This value is set to the RenderSsaoPostProcess.NormalDepthShaderResourceView property by this class.
Public propertyOcclusionFadeEnd OcclusionFadeStart, OcclusionFadeEnd and SurfaceEpsilon defines at which distance the occlusion shadow starts to fade and when it is not visibly any more. OcclusionFadeEnd's default value is 2.0.
Public propertyOcclusionFadeStart OcclusionFadeStart, OcclusionFadeEnd and SurfaceEpsilon defines at which distance the occlusion shadow starts to fade and when it is not visibly any more. OcclusionFadeStart's default value is 0.2.
Public propertyOcclusionRadius Gets or sets a float value that specifies how big is the radius that is used to define the occlusion position. Increase this value to make the occlusion effect bigger and shown on wider area. Default value is 0.5.
Public propertyPrepareSsaoRenderingStep Gets a PrepareSsaoRenderingStep that prepares render targets for SSAO rendering.
Public propertyRenderNonShadowObjectsRenderingStep Gets a RenderObjectsRenderingStep that renders all objects that do not receive shadow.
Public propertyRenderSsaoPostProcessingRenderingStep Gets a RenderPostProcessingRenderingStep that runs a post process that renders and blurs the SSAO texture.
Public propertyShadowTextureHeight Gets or sets the height of SSAO shadow texture. When IsShadowTextureSizePercent is true (by default), then this value defines the relative height based on the current height of the DXScene. When IsShadowTextureSizePercent is false, then this value defines the absolute height in pixels (converted to int). Default value is 0.5f (50% of the current DXScene height).
Public propertyShadowTextureWidth Gets or sets the width of the SSAO shadow texture. When IsShadowTextureSizePercent is true (by default), then this value defines the relative width based on the current width of the DXScene. When IsShadowTextureSizePercent is false, then this value defines the absolute width in pixels (converted to int). Default value is 0.5f (50% of the current DXScene width).
Public propertySharpenPower Gets or sets a float that defines how intense the SSAO shadow is. Increase this value to make the shadow more strong. Default value is 4.
Public propertySsaoNormalDepthRenderingStep Gets a RenderObjectsRenderingStep that renders scene to normal-depth texture.
Public propertySsaoRenderingStepsGroup Gets a RenderingStepsGroup that groups rendering step that render Screen Space Ambient Occlusion (SSAO) shadow map.
Public propertySsaoShaderResourceView Gets the ShaderResourceView that has the current SSAO texture. The texture has R16_UNorm format (0 means full shadow, 1 means no shadow).
Public propertySsaoTextureBlurCount Gets or sets an integer that specify how many times the SSAO texture is blurred before it is used to render objects. Without blurring the individual randomized samples are visible. Blurring prevents that. Reduce this number to increase performance of SSAO. Default value is 4 (executing 4 horizontal and 4 vertical blur post processes).
Public propertySurfaceEpsilon OcclusionFadeStart, OcclusionFadeEnd and SurfaceEpsilon defines at which distance the occlusion shadow starts to fade and when it is not visibly any more. SurfaceEpsilon's default value is 0.05.
Top
Fields
 NameDescription
Public fieldStatic memberChangeRenderTargetFromSsaoRenderingStepName Name for RenderingStep that changes the render targets from SSAO rendering to rendering 3D scene.
Public fieldStatic memberPrepareSsaoRenderingStepName Name of the RenderingStep that prepares parameters for other rendering steps for SSAO.
Public fieldStatic memberRenderSsaoPostProcessingRenderingStepName Name for RenderingStep that renders and blurs the SSAO texture.
Public fieldStatic memberSsaoNormalDepthRenderingStepName Name of the RenderingStep that rendered 3D scene to normal-depth texture.
Public fieldStatic memberSsaoRenderingStepsGroupName Name of the RenderingStepsGroup that contains rendering steps that render Screen Space Ambient Occlusion (SSAO) shadow map.
Top
See Also