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