From e9dd61dda3cf62df2766cf2d08a8c0230af6dac9 Mon Sep 17 00:00:00 2001 From: Guzhban Mambetov Date: Thu, 14 Apr 2022 22:47:51 +0400 Subject: [PATCH 1/2] Add the possibility to pass forcedExtension for an environment texture --- packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts b/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts index b7d3c13edf2..0f4711b5e0d 100644 --- a/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts +++ b/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts @@ -180,7 +180,11 @@ const loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError scene.environmentTexture = hdrTexture; } else { if (EndsWith(parsedData.environmentTexture, ".env")) { - const compressedTexture = new CubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene); + const compressedTexture = new CubeTexture( + (parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, + scene, + parsedData.environmentTextureForcedExtension + ); if (parsedData.environmentTextureRotationY) { compressedTexture.rotationY = parsedData.environmentTextureRotationY; } From f72e525eb4f46c80aaf5c653800c4f2a7f3aff36 Mon Sep 17 00:00:00 2001 From: Guzhban Date: Sat, 30 Apr 2022 22:36:14 +0400 Subject: [PATCH 2/2] Add the possibility to pass forcedExtension for a serialized environment texture --- packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts b/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts index 0f4711b5e0d..a2e0950a113 100644 --- a/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts +++ b/packages/dev/core/src/Loading/Plugins/babylonFileLoader.ts @@ -192,7 +192,8 @@ const loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError } else { const cubeTexture = CubeTexture.CreateFromPrefilteredData( (parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, - scene + scene, + parsedData.environmentTextureForcedExtension ); if (parsedData.environmentTextureRotationY) { cubeTexture.rotationY = parsedData.environmentTextureRotationY;