|
@@ -645,9 +645,11 @@ module BABYLON {
|
|
|
|
|
|
// 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);
|
|
|
+ var hdrTexture = new HDRCubeTexture(rootUrl + parsedData.environmentTexture, scene, hdrSize, true, !isPBR);
|
|
|
if (parsedData.environmentTextureRotationY) {
|
|
|
hdrTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
}
|
|
@@ -662,8 +664,7 @@ module BABYLON {
|
|
|
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;
|
|
|
- var skyboxIsPBR = parsedData.skyboxIsPBR !== undefined ? parsedData.skyboxIsPBR : true;
|
|
|
- scene.createDefaultSkybox(scene.environmentTexture, skyboxIsPBR, skyboxScale, skyboxBlurLevel);
|
|
|
+ scene.createDefaultSkybox(scene.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel);
|
|
|
}
|
|
|
}
|
|
|
// Finish
|