MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / SSAOEffect

Class SSAOEffect

src/effects/SSAOEffect.js:27–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 */
26
27export class SSAOEffect extends Effect {
28
29 /**
30 * Constructs a new SSAO effect.
31 *
32 * @todo Move normalBuffer to options.
33 * @param {Camera} [camera] - The main camera.
34 * @param {Texture} [normalBuffer] - A texture that contains the scene normals.
35 * @param {Object} [options] - The options.
36 * @param {BlendFunction} [options.blendFunction=BlendFunction.MULTIPLY] - The blend function of this effect.
37 * @param {Boolean} [options.distanceScaling=true] - Deprecated.
38 * @param {Boolean} [options.depthAwareUpsampling=true] - Enables or disables depth-aware upsampling. Has no effect if WebGL 2 is not supported.
39 * @param {Texture} [options.normalDepthBuffer=null] - Deprecated.
40 * @param {Number} [options.samples=9] - The amount of samples per pixel. Should not be a multiple of the ring count.
41 * @param {Number} [options.rings=7] - The amount of spiral turns in the occlusion sampling pattern. Should be a prime number.
42 * @param {Number} [options.worldDistanceThreshold] - The world distance threshold at which the occlusion effect starts to fade out.
43 * @param {Number} [options.worldDistanceFalloff] - The world distance falloff. Influences the smoothness of the occlusion cutoff.
44 * @param {Number} [options.worldProximityThreshold] - The world proximity threshold at which the occlusion starts to fade out.
45 * @param {Number} [options.worldProximityFalloff] - The world proximity falloff. Influences the smoothness of the proximity cutoff.
46 * @param {Number} [options.distanceThreshold=0.97] - Deprecated.
47 * @param {Number} [options.distanceFalloff=0.03] - Deprecated.
48 * @param {Number} [options.rangeThreshold=0.0005] - Deprecated.
49 * @param {Number} [options.rangeFalloff=0.001] - Deprecated.
50 * @param {Number} [options.minRadiusScale=0.1] - The minimum radius scale.
51 * @param {Number} [options.luminanceInfluence=0.7] - Determines how much the luminance of the scene influences the ambient occlusion.
52 * @param {Number} [options.radius=0.1825] - The occlusion sampling radius, expressed as a scale relative to the resolution. Range [1e-6, 1.0].
53 * @param {Number} [options.intensity=1.0] - The intensity of the ambient occlusion.
54 * @param {Number} [options.bias=0.025] - An occlusion bias. Eliminates artifacts caused by depth discontinuities.
55 * @param {Number} [options.fade=0.01] - Influences the smoothness of the shadows. A lower value results in higher contrast.
56 * @param {Color} [options.color=null] - The color of the ambient occlusion.
57 * @param {Number} [options.resolutionScale=1.0] - The resolution scale.
58 * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.
59 * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.
60 * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.
61 * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.
62 */
63
64 constructor(camera, normalBuffer, {
65 blendFunction = BlendFunction.MULTIPLY,
66 samples = 9,
67 rings = 7,
68 normalDepthBuffer = null,
69 depthAwareUpsampling = true,
70 worldDistanceThreshold,
71 worldDistanceFalloff,
72 worldProximityThreshold,
73 worldProximityFalloff,
74 distanceThreshold = 0.97,
75 distanceFalloff = 0.03,
76 rangeThreshold = 0.0005,
77 rangeFalloff = 0.001,
78 minRadiusScale = 0.1,
79 luminanceInfluence = 0.7,
80 radius = 0.1825,
81 intensity = 1.0,
82 bias = 0.025,
83 fade = 0.01,
84 color = null,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…