AmbientLightProbe.js 435 B

1234567891011121314151617181920
  1. import { Color } from '../math/Color.js';
  2. import { LightProbe } from './LightProbe.js';
  3. class AmbientLightProbe extends LightProbe {
  4. constructor( color, intensity = 1 ) {
  5. super( undefined, intensity );
  6. this.isAmbientLightProbe = true;
  7. const color1 = new Color().set( color );
  8. this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 / Math.sqrt( Math.PI ) );
  9. }
  10. }
  11. export { AmbientLightProbe };