three-cad-viewer 4.3.7 → 4.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,14 @@ interface EnvironmentManagerOptions {
31
31
  declare class EnvironmentManager {
32
32
  /** Cached PMREM render targets keyed by environment name or URL */
33
33
  private _cache;
34
+ /**
35
+ * Cached raw equirectangular HDR textures keyed by the same name/URL.
36
+ * Preserved (not disposed after PMREM generation) so `scene.background`
37
+ * can sample the original HDR at full source resolution instead of the
38
+ * 256² PMREM cubemap. Only populated by `_loadHdr` — procedural
39
+ * environments have no source HDR.
40
+ */
41
+ private _hdrCache;
34
42
  /** Cached light detection results keyed by environment name or URL */
35
43
  private _lightDetectionCache;
36
44
  /** In-flight load promises keyed by environment name or URL */
@@ -47,6 +55,13 @@ declare class EnvironmentManager {
47
55
  private _hdrLoader;
48
56
  /** The last loaded PMREM texture (stateful — used by apply() for IBL) */
49
57
  private _currentTexture;
58
+ /**
59
+ * Raw HDR texture corresponding to `_currentTexture`, used for
60
+ * `scene.background` to keep the backdrop at source resolution. Null when
61
+ * the current environment is procedural ("studio" RoomEnvironment) — in
62
+ * that case the background falls back to `_currentTexture` (the PMREM).
63
+ */
64
+ private _currentBackgroundTexture;
50
65
  /** Whether this manager has been disposed */
51
66
  private _disposed;
52
67
  /**
@@ -221,9 +236,10 @@ declare class EnvironmentManager {
221
236
  * Load an HDR file and generate a PMREM texture from it.
222
237
  *
223
238
  * Uses HDRLoader to fetch the .hdr file, then PMREMGenerator.fromEquirectangular()
224
- * to create the PMREM cubemap. The source equirectangular texture is disposed
225
- * after PMREM generation. The PMREM texture itself serves as both the IBL
226
- * environment and the background (in "environment" mode).
239
+ * to create the PMREM cubemap for IBL. The source equirectangular HDR is
240
+ * preserved and cached separately (in `_hdrCache`) so that "environment"
241
+ * background mode can sample the full-resolution equirectangular texture
242
+ * instead of the 256² PMREM cubemap.
227
243
  *
228
244
  * @param url - URL of the .hdr file
229
245
  * @param cacheKey - Cache key for the resulting PMREM render target