UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 1.25 kB
import{aZ as e}from"./index-BPURObVq.esm.min.js";class t{constructor(t){this.name=e.NAME_SHADOWGENERATOR,this.scene=t}register(){this.scene._gatherRenderTargetsStage.registerStep(e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)}rebuild(){}serialize(e){e.shadowGenerators=[];const t=this.scene.lights;for(const s of t){if(s.doNotSerialize)continue;const t=s.getShadowGenerators();if(t){const s=t.values();for(let t=s.next();!0!==t.done;t=s.next()){const s=t.value;s.doNotSerialize||e.shadowGenerators.push(s.serialize())}}}}addFromContainer(e){}removeFromContainer(e,t){}dispose(){}_gatherRenderTargets(e){const t=this.scene;if(this.scene.shadowsEnabled)for(let s=0;s<t.lights.length;s++){const n=t.lights[s],o=n.getShadowGenerators();if(n.isEnabled()&&n.shadowEnabled&&o){const s=o.values();for(let n=s.next();!0!==n.done;n=s.next()){const s=n.value.getShadowMap();-1!==t.textures.indexOf(s)&&e.push(s)}}}}}let s=!1;function n(n){s||(s=!0,n._SceneComponentInitialization=s=>{let n=s._getComponent(e.NAME_SHADOWGENERATOR);n||(n=new t(s),s._addComponent(n))})}export{n as RegisterShadowGeneratorSceneComponent,t as ShadowGeneratorSceneComponent}; //# sourceMappingURL=shadowGeneratorSceneComponent-BCt7XsPW.esm.min.js.map