"use strict";exports.__esModule=!0,exports.default=void 0;var _three=require("three"),_RGBELoader=require("three/examples/jsm/loaders/RGBELoader"),_extension=require("../../core/extension"),_default=exports.default=(0,_extension.definePlugin)("hdr",{setup(a,b){let c;const d=new _three.PMREMGenerator(b.renderer);d.compileEquirectangularShader(),this.loadHDRAsync(a.hdrUrl).then(a=>{c=d.fromEquirectangular(a).texture,a.dispose(),d.dispose(),b.scene.environment=c});return{loadHDRAsync:async a=>{let b=await new Promise((b,c)=>{new _RGBELoader.RGBELoader().load(a,function(a){b(a)})});return b.mapping=_three.EquirectangularReflectionMapping,b},remove:()=>{c&&c.dispose(),d.dispose()}}},destroyed(){this.remove()}});