UNPKG

538 BJavaScriptView Raw
1import { Color } from '../math/Color.js';
2import { LightProbe } from './LightProbe.js';
3
4class 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
19AmbientLightProbe.prototype.isAmbientLightProbe = true;
20
21export { AmbientLightProbe };