|
@@ -748,38 +748,6 @@ SceneLoader.RegisterPlugin({
|
|
|
scene.setActiveCameraByID(parsedData.activeCameraID);
|
|
|
}
|
|
|
|
|
|
- // Environment texture
|
|
|
- if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) {
|
|
|
- // PBR needed for both HDR texture (gamma space) & a sky box
|
|
|
- var isPBR = parsedData.isPBR !== undefined ? parsedData.isPBR : true;
|
|
|
- if (parsedData.environmentTextureType && parsedData.environmentTextureType === "BABYLON.HDRCubeTexture") {
|
|
|
- var hdrSize: number = (parsedData.environmentTextureSize) ? parsedData.environmentTextureSize : 128;
|
|
|
- var hdrTexture = new HDRCubeTexture(rootUrl + parsedData.environmentTexture, scene, hdrSize, true, !isPBR);
|
|
|
- if (parsedData.environmentTextureRotationY) {
|
|
|
- hdrTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
- }
|
|
|
- scene.environmentTexture = hdrTexture;
|
|
|
- } else {
|
|
|
- if (StringTools.EndsWith(parsedData.environmentTexture, ".env")) {
|
|
|
- var compressedTexture = new CubeTexture(rootUrl + parsedData.environmentTexture, scene);
|
|
|
- if (parsedData.environmentTextureRotationY) {
|
|
|
- compressedTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
- }
|
|
|
- scene.environmentTexture = compressedTexture;
|
|
|
- } else {
|
|
|
- var cubeTexture = CubeTexture.CreateFromPrefilteredData(rootUrl + parsedData.environmentTexture, scene);
|
|
|
- if (parsedData.environmentTextureRotationY) {
|
|
|
- cubeTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
- }
|
|
|
- scene.environmentTexture = cubeTexture;
|
|
|
- }
|
|
|
- }
|
|
|
- if (parsedData.createDefaultSkybox === true) {
|
|
|
- var skyboxScale = (scene.activeCamera !== undefined && scene.activeCamera !== null) ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1000;
|
|
|
- var skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;
|
|
|
- scene.createDefaultSkybox(scene.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel);
|
|
|
- }
|
|
|
- }
|
|
|
// Finish
|
|
|
return true;
|
|
|
} catch (err) {
|