Documentation / scene / SAO
Class: SAO
Defined in: libs/scene/src/posteffect/sao.ts:69
The Scalable Ambient Obscurance (SAO) post effect
Extends
Constructors
Constructor
new SAO():
SAO
Defined in: libs/scene/src/posteffect/sao.ts:89
Creates an instance of SAO post effect
Returns
SAO
Overrides
AbstractPostEffect.constructor
Properties
_enabled
protected_enabled:boolean
Defined in: libs/scene/src/posteffect/posteffect.ts:117
Inherited from
_layer
protected_layer:PostEffectLayer
Defined in: libs/scene/src/posteffect/posteffect.ts:118
Inherited from
Accessors
disposed
Get Signature
get disposed():
boolean
Defined in: libs/base/dist/index.d.ts:6065
Returns
boolean
Inherited from
enabled
Get Signature
get enabled():
boolean
Defined in: libs/scene/src/posteffect/posteffect.ts:129
Whether this post effect is enabled
Returns
boolean
Set Signature
set enabled(
val):void
Defined in: libs/scene/src/posteffect/posteffect.ts:132
Parameters
val
boolean
Returns
void
Inherited from
layer
Get Signature
get layer():
PostEffectLayer
Defined in: libs/scene/src/posteffect/posteffect.ts:136
Whether this post effect will be rendered at opaque phase
Returns
Inherited from
scale
Get Signature
get scale():
number
Defined in: libs/scene/src/posteffect/sao.ts:108
Scale value
Returns
number
Set Signature
set scale(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:111
Parameters
val
number
Returns
void
bias
Get Signature
get bias():
number
Defined in: libs/scene/src/posteffect/sao.ts:115
Bias value
Returns
number
Set Signature
set bias(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:118
Parameters
val
number
Returns
void
radius
Get Signature
get radius():
number
Defined in: libs/scene/src/posteffect/sao.ts:122
Radius value
Returns
number
Set Signature
set radius(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:125
Parameters
val
number
Returns
void
intensity
Get Signature
get intensity():
number
Defined in: libs/scene/src/posteffect/sao.ts:129
SAO intensity
Returns
number
Set Signature
set intensity(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:132
Parameters
val
number
Returns
void
minResolution
Get Signature
get minResolution():
number
Defined in: libs/scene/src/posteffect/sao.ts:136
Minimum resolution
Returns
number
Set Signature
set minResolution(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:139
Parameters
val
number
Returns
void
blurKernelSize
Get Signature
get blurKernelSize():
number
Defined in: libs/scene/src/posteffect/sao.ts:143
Blur kernel size
Returns
number
Set Signature
set blurKernelSize(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:146
Parameters
val
number
Returns
void
blurStdDev
Get Signature
get blurStdDev():
number
Defined in: libs/scene/src/posteffect/sao.ts:152
Gaussian blur stddev value
Returns
number
Set Signature
set blurStdDev(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:155
Parameters
val
number
Returns
void
blurDepthCutoff
Get Signature
get blurDepthCutoff():
number
Defined in: libs/scene/src/posteffect/sao.ts:160
Cutoff of depth limited blur
Returns
number
Set Signature
set blurDepthCutoff(
val):void
Defined in: libs/scene/src/posteffect/sao.ts:163
Parameters
val
number
Returns
void
Methods
on()
on<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:594
IEventTarget.on
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
once()
once<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:598
IEventTarget.once
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
off()
off<
K>(type,listener?,context?):void
Defined in: libs/base/dist/index.d.ts:602
IEventTarget.off
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener?
EventListener<{ dispose: []; }>
context?
unknown
Returns
void
Inherited from
dispatchEvent()
dispatchEvent<
K>(type, ...args):void
Defined in: libs/base/dist/index.d.ts:606
IEventTarget.dispatchEvent
Type Parameters
K
K extends "dispose"
Parameters
type
K
args
...object[K]
Returns
void
Inherited from
AbstractPostEffect.dispatchEvent
dispose()
dispose():
void
Defined in: libs/base/dist/index.d.ts:6066
Returns
void
Inherited from
needFlip()
needFlip(
device):boolean
Defined in: libs/scene/src/posteffect/posteffect.ts:144
Check if the post effect should be rendered upside down.
Parameters
device
AbstractDevice
The device object
Returns
boolean
true if the post effect should be rendered upside down
Inherited from
requireMotionVectorTexture()
requireMotionVectorTexture(
_ctx):boolean
Defined in: libs/scene/src/posteffect/posteffect.ts:165
Checks whether this post effect requires the motion vector texture
Parameters
_ctx
Returns
boolean
true if the motion vector texture is required.
Inherited from
AbstractPostEffect.requireMotionVectorTexture
setup()
setup(
s):RGHandle
Defined in: libs/scene/src/posteffect/posteffect.ts:193
Declare this effect's passes on the render graph.
The default implementation wraps AbstractPostEffect.apply into a single graph pass, so effects only overriding apply() work unchanged. Multi-pass effects override this method to declare each internal step as its own pass, calling PostEffectSetupContext.createOutput inside the final pass.
Parameters
s
Build-time setup context.
Returns
The effect's output color handle.
Inherited from
passThrough()
protectedpassThrough(ctx,inputColorTexture,srgbOutput,renderStates?):void
Defined in: libs/scene/src/posteffect/posteffect.ts:269
Parameters
ctx
Draw context
inputColorTexture
Texture2D
Input color texture
srgbOutput
boolean
Whether the result should be gamma corrected
renderStates?
RenderStateSet
Returns
void
Inherited from
AbstractPostEffect.passThrough
drawFullscreenQuad()
protecteddrawFullscreenQuad(renderStateSet?):void
Defined in: libs/scene/src/posteffect/posteffect.ts:288
Draws a fullscreen quad
Parameters
renderStateSet?
RenderStateSet
Render states that will be used when drawing the fullscreen quad.
Returns
void
Inherited from
AbstractPostEffect.drawFullscreenQuad
onDispose()
protectedonDispose():void
Defined in: libs/scene/src/posteffect/posteffect.ts:301
Returns
void
Inherited from
requireLinearDepthTexture()
requireLinearDepthTexture():
boolean
Defined in: libs/scene/src/posteffect/sao.ts:167
Checks whether this post effect requires the linear depth texture
Returns
boolean
true if the linear depth texture is required.
Overrides
AbstractPostEffect.requireLinearDepthTexture
requireDepthAttachment()
requireDepthAttachment():
boolean
Defined in: libs/scene/src/posteffect/sao.ts:171
Checks whether this post effect requires the scene depth buffer
Returns
boolean
true if the scene depth buffer is required.
Overrides
AbstractPostEffect.requireDepthAttachment
apply()
apply(
ctx,inputColorTexture,sceneDepthTexture,srgbOutput):void
Defined in: libs/scene/src/posteffect/sao.ts:175
Apply the post effect
Parameters
ctx
inputColorTexture
Texture2D
The previous scene color texture
sceneDepthTexture
Texture2D
The linear scene depth texture
srgbOutput
boolean
Whether the result should be gamma corrected
Returns
void
Remarks
The frame buffer of the post effect is already set when apply() is called.