"use strict";exports.__esModule=!0,exports.default=void 0;var _three=require("three"),_RoomEnvironment=require("three/examples/jsm/environments/RoomEnvironment.js"),_extension=require("../../core/extension"),_default=exports.default=(0,_extension.definePlugin)("env-room",{setup(a,b){let c,d;"webgl"===b.renderer.type&&(c=new _three.PMREMGenerator(b.renderer),c.compileEquirectangularShader(),d=c.fromScene(new _RoomEnvironment.RoomEnvironment,a.sigma,a.near,a.far).texture,d.format=_three.RGBAFormat,b.scene.environment=d);const e=()=>{d&&d.dispose(),c&&c.dispose()};return{remove:e}},destroyed(){this.remove()}});