import{b as h,av as p}from"./index-6jOCfdig.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";class m{constructor(e){this.name=h.NAME_SHADOWGENERATOR,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(h.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)}rebuild(){}serialize(e){e.shadowGenerators=[];const t=this.scene.lights;for(const o of t){if(o.doNotSerialize)continue;const r=o.getShadowGenerators();if(r){const i=r.values();for(let n=i.next();n.done!==!0;n=i.next()){const s=n.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 o=0;o<t.lights.length;o++){const r=t.lights[o],i=r.getShadowGenerators();if(r.isEnabled()&&r.shadowEnabled&&i){const n=i.values();for(let s=n.next();s.done!==!0;s=n.next()){const d=s.value.getShadowMap();t.textures.indexOf(d)!==-1&&e.push(d)}}}}}p._SceneComponentInitialization=a=>{let e=a._getComponent(h.NAME_SHADOWGENERATOR);e||(e=new m(a),a._addComponent(e))};export{m as ShadowGeneratorSceneComponent};
