* Constructs a new SSAO pass. * * @param {Scene} scene - The scene to compute the AO for. * @param {Camera} camera - The camera. * @param {number} [width=512] - The width of the effect. * @param {number} [height=512] - The height of the effect. * @param {number} [kernelSize=32] - The ker
( scene, camera, width = 512, height = 512, kernelSize = 32 )
| 53 | * @param {number} [kernelSize=32] - The kernel size. |
| 54 | */ |
| 55 | constructor( scene, camera, width = 512, height = 512, kernelSize = 32 ) { |
| 56 | |
| 57 | super(); |
| 58 | |
| 59 | /** |
| 60 | * The width of the effect. |
| 61 | * |
| 62 | * @type {number} |
| 63 | * @default 512 |
| 64 | */ |
| 65 | this.width = width; |
| 66 | |
| 67 | /** |
| 68 | * The height of the effect. |
| 69 | * |
| 70 | * @type {number} |
| 71 | * @default 512 |
| 72 | */ |
| 73 | this.height = height; |
| 74 | |
| 75 | /** |
| 76 | * Overwritten to perform a clear operation by default. |
| 77 | * |
| 78 | * @type {boolean} |
| 79 | * @default true |
| 80 | */ |
| 81 | this.clear = true; |
| 82 | |
| 83 | /** |
| 84 | * Overwritten to disable the swap. |
| 85 | * |
| 86 | * @type {boolean} |
| 87 | * @default false |
| 88 | */ |
| 89 | this.needsSwap = false; |
| 90 | |
| 91 | /** |
| 92 | * The camera. |
| 93 | * |
| 94 | * @type {Camera} |
| 95 | */ |
| 96 | this.camera = camera; |
| 97 | |
| 98 | /** |
| 99 | * The scene to render the AO for. |
| 100 | * |
| 101 | * @type {Scene} |
| 102 | */ |
| 103 | this.scene = scene; |
| 104 | |
| 105 | /** |
| 106 | * The kernel radius controls how wide the |
| 107 | * AO spreads. |
| 108 | * |
| 109 | * @type {number} |
| 110 | * @default 8 |
| 111 | */ |
| 112 | this.kernelRadius = 8; |
nothing calls this directly
no test coverage detected