1 | import { Color } from '../math/Color.js';
|
2 | import { LightProbe } from './LightProbe.js';
|
3 |
|
4 | class AmbientLightProbe extends LightProbe {
|
5 |
|
6 | constructor( color, intensity = 1 ) {
|
7 |
|
8 | super( undefined, intensity );
|
9 |
|
10 | const color1 = new Color().set( color );
|
11 |
|
12 | // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );
|
13 | this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) );
|
14 |
|
15 | }
|
16 |
|
17 | }
|
18 |
|
19 | AmbientLightProbe.prototype.isAmbientLightProbe = true;
|
20 |
|
21 | export { AmbientLightProbe };
|