import{PMREMGenerator,RGBAFormat}from"three";import{RoomEnvironment}from"three/examples/jsm/environments/RoomEnvironment.js";import{definePlugin}from"../../core/extension";export default definePlugin("env-room",{setup(a,b){let c,d;"webgl"===b.renderer.type&&(c=new PMREMGenerator(b.renderer),c.compileEquirectangularShader(),d=c.fromScene(new RoomEnvironment,a.sigma,a.near,a.far).texture,d.format=RGBAFormat,b.scene.environment=d);const e=()=>{d&&d.dispose(),c&&c.dispose()};return{remove:e}},destroyed(){this.remove()}});