* Constructs a new selective bloom effect. * * @param {Scene} scene - The main scene. * @param {Camera} camera - The main camera. * @param {Object} [options] - The options. See BloomEffect for details.
(scene, camera, options)
| 34 | */ |
| 35 | |
| 36 | constructor(scene, camera, options) { |
| 37 | |
| 38 | super(options); |
| 39 | |
| 40 | this.setAttributes(this.getAttributes() | EffectAttribute.DEPTH); |
| 41 | |
| 42 | /** |
| 43 | * The main camera. |
| 44 | * |
| 45 | * @type {Camera} |
| 46 | * @private |
| 47 | */ |
| 48 | |
| 49 | this.camera = camera; |
| 50 | |
| 51 | /** |
| 52 | * A depth pass. |
| 53 | * |
| 54 | * @type {DepthPass} |
| 55 | * @private |
| 56 | */ |
| 57 | |
| 58 | this.depthPass = new DepthPass(scene, camera); |
| 59 | |
| 60 | /** |
| 61 | * A clear pass. |
| 62 | * |
| 63 | * @type {ClearPass} |
| 64 | * @private |
| 65 | */ |
| 66 | |
| 67 | this.clearPass = new ClearPass(true, false, false); |
| 68 | this.clearPass.overrideClearColor = new Color(0x000000); |
| 69 | |
| 70 | /** |
| 71 | * A depth mask pass. |
| 72 | * |
| 73 | * @type {ShaderPass} |
| 74 | * @private |
| 75 | */ |
| 76 | |
| 77 | this.depthMaskPass = new ShaderPass(new DepthMaskMaterial()); |
| 78 | |
| 79 | const depthMaskMaterial = this.depthMaskMaterial; |
| 80 | depthMaskMaterial.copyCameraSettings(camera); |
| 81 | depthMaskMaterial.depthBuffer1 = this.depthPass.texture; |
| 82 | depthMaskMaterial.depthPacking1 = RGBADepthPacking; |
| 83 | depthMaskMaterial.depthMode = EqualDepth; |
| 84 | |
| 85 | /** |
| 86 | * A render target. |
| 87 | * |
| 88 | * @type {WebGLRenderTarget} |
| 89 | * @private |
| 90 | */ |
| 91 | |
| 92 | this.renderTargetMasked = new WebGLRenderTarget(1, 1, { depthBuffer: false }); |
| 93 | this.renderTargetMasked.texture.name = "Bloom.Masked"; |
nothing calls this directly
no test coverage detected