* Constructs a new SSAO material. * * @param {Camera} camera - A camera.
(camera)
| 20 | */ |
| 21 | |
| 22 | constructor(camera) { |
| 23 | |
| 24 | super({ |
| 25 | name: "SSAOMaterial", |
| 26 | defines: { |
| 27 | SAMPLES_INT: "0", |
| 28 | INV_SAMPLES_FLOAT: "0.0", |
| 29 | SPIRAL_TURNS: "0.0", |
| 30 | RADIUS: "1.0", |
| 31 | RADIUS_SQ: "1.0", |
| 32 | DISTANCE_SCALING: "1", |
| 33 | DEPTH_PACKING: "0" |
| 34 | }, |
| 35 | uniforms: { |
| 36 | depthBuffer: new Uniform(null), |
| 37 | normalBuffer: new Uniform(null), |
| 38 | normalDepthBuffer: new Uniform(null), |
| 39 | noiseTexture: new Uniform(null), |
| 40 | inverseProjectionMatrix: new Uniform(new Matrix4()), |
| 41 | projectionMatrix: new Uniform(new Matrix4()), |
| 42 | texelSize: new Uniform(new Vector2()), |
| 43 | cameraNearFar: new Uniform(new Vector2()), |
| 44 | distanceCutoff: new Uniform(new Vector2()), |
| 45 | proximityCutoff: new Uniform(new Vector2()), |
| 46 | noiseScale: new Uniform(new Vector2()), |
| 47 | minRadiusScale: new Uniform(0.33), |
| 48 | intensity: new Uniform(1.0), |
| 49 | fade: new Uniform(0.01), |
| 50 | bias: new Uniform(0.0) |
| 51 | }, |
| 52 | blending: NoBlending, |
| 53 | toneMapped: false, |
| 54 | depthWrite: false, |
| 55 | depthTest: false, |
| 56 | fragmentShader, |
| 57 | vertexShader |
| 58 | }); |
| 59 | |
| 60 | this.copyCameraSettings(camera); |
| 61 | |
| 62 | /** |
| 63 | * The resolution. |
| 64 | * |
| 65 | * @type {Vector2} |
| 66 | * @private |
| 67 | */ |
| 68 | |
| 69 | this.resolution = new Vector2(); |
| 70 | |
| 71 | /** |
| 72 | * The relative sampling radius. |
| 73 | * |
| 74 | * @type {Number} |
| 75 | * @private |
| 76 | */ |
| 77 | |
| 78 | this.r = 1.0; |
| 79 |
nothing calls this directly
no test coverage detected