/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/vec3","../../../../chunks/vec3f64","./Lightsources","./SphericalHarmonics"],(function(i,t,e,n,o,s){"use strict";const r=.4;let h=function(){function i(){this._shOrder=2,this._oldSunlight={direction:n.create(),ambient:{color:n.create(),intensity:1},diffuse:{color:n.create(),intensity:1}},this.globalFactor=.5,this.groundLightingFactor=.5,this._sphericalHarmonics=new o.SphericalHarmonicsAmbientLight,this._mainLight={intensity:n.create(),direction:n.fromValues(1,0,0),castShadows:!1,specularStrength:1,environmentStrength:1}}return i.prototype.set=function(i){s.combineLights(i,this._shOrder,this._mainLight,this._sphericalHarmonics),e.copy(this._oldSunlight.direction,this._mainLight.direction);const t=1/Math.PI;this._oldSunlight.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._oldSunlight.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._oldSunlight.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,e.scale(this._oldSunlight.diffuse.color,this._mainLight.intensity,t),e.copy(c,this._oldSunlight.diffuse.color),e.scale(c,c,r*this.globalFactor),e.add(this._oldSunlight.ambient.color,this._oldSunlight.ambient.color,c)},t._createClass(i,[{key:"sh",get:function(){return this._sphericalHarmonics}},{key:"mainLight",get:function(){return this._mainLight}},{key:"lightingMainDirection",get:function(){return this._mainLight.direction}},{key:"old",get:function(){return this._oldSunlight}}]),i}();const c=n.create();i.SceneLighting=h,i.ambientBoost=r,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
