@@ -28,7 +28,7 @@ public sealed class AmbientOcclusionQualityParameter : ParameterOverride<Ambient
2828 public sealed class AmbientOcclusion : PostProcessEffectSettings
2929 {
3030 // Shared parameters
31- [ Tooltip ( "The ambient occlusion method to use. \" Modern \" is higher quality and faster on desktop & console platforms but requires compute shader support." ) ]
31+ [ Tooltip ( "The ambient occlusion method to use. \" MSVO \" is higher quality and faster on desktop & console platforms but requires compute shader support." ) ]
3232 public AmbientOcclusionModeParameter mode = new AmbientOcclusionModeParameter { value = AmbientOcclusionMode . MultiScaleVolumetricObscurance } ;
3333
3434 [ Range ( 0f , 4f ) , Tooltip ( "Degree of darkness added by ambient occlusion." ) ]
@@ -53,6 +53,10 @@ public sealed class AmbientOcclusion : PostProcessEffectSettings
5353 [ Range ( 1f , 10f ) , Tooltip ( "Modifies thickness of occluders. This increases dark areas but also introduces dark halo around objects." ) ]
5454 public FloatParameter thicknessModifier = new FloatParameter { value = 1f } ;
5555
56+ // HDRP-only parameters
57+ [ Range ( 0f , 1f ) , Tooltip ( "" ) ]
58+ public FloatParameter directLightingStrength = new FloatParameter { value = 0f } ;
59+
5660 // SAO-only parameters
5761 [ Tooltip ( "Radius of sample points, which affects extent of darkened areas." ) ]
5862 public FloatParameter radius = new FloatParameter { value = 0.25f } ;
@@ -63,11 +67,23 @@ public sealed class AmbientOcclusion : PostProcessEffectSettings
6367 public override bool IsEnabledAndSupported ( PostProcessRenderContext context )
6468 {
6569 bool state = enabled . value
66- && intensity . value > 0f
67- && ! RuntimeUtilities . scriptableRenderPipelineActive ;
70+ && intensity . value > 0f ;
6871
69- if ( mode . value == AmbientOcclusionMode . MultiScaleVolumetricObscurance )
70- state &= SystemInfo . supportsComputeShaders && SystemInfo . SupportsRenderTextureFormat ( RenderTextureFormat . RFloat ) ;
72+ if ( mode . value == AmbientOcclusionMode . ScalableAmbientObscurance )
73+ {
74+ state &= ! RuntimeUtilities . scriptableRenderPipelineActive ;
75+ }
76+ else if ( mode . value == AmbientOcclusionMode . MultiScaleVolumetricObscurance )
77+ {
78+ #if UNITY_2017_1_OR_NEWER
79+ state &= SystemInfo . supportsComputeShaders
80+ && SystemInfo . SupportsRenderTextureFormat ( RenderTextureFormat . RFloat )
81+ && SystemInfo . SupportsRenderTextureFormat ( RenderTextureFormat . RHalf )
82+ && SystemInfo . SupportsRenderTextureFormat ( RenderTextureFormat . R8 ) ;
83+ #else
84+ state = false ;
85+ #endif
86+ }
7187
7288 return state ;
7389 }
@@ -122,6 +138,16 @@ public override void Release()
122138 m . Release ( ) ;
123139 }
124140
141+ public ScalableAO GetScalableAO ( )
142+ {
143+ return ( ScalableAO ) m_Methods [ ( int ) AmbientOcclusionMode . ScalableAmbientObscurance ] ;
144+ }
145+
146+ public MultiScaleVO GetMultiScaleVO ( )
147+ {
148+ return ( MultiScaleVO ) m_Methods [ ( int ) AmbientOcclusionMode . MultiScaleVolumetricObscurance ] ;
149+ }
150+
125151 // Unused
126152 public override void Render ( PostProcessRenderContext context )
127153 {
0 commit comments