|
@@ -680,7 +680,20 @@
|
|
|
|
|
|
// Environment texture
|
|
// Environment texture
|
|
if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) {
|
|
if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) {
|
|
- scene.environmentTexture = CubeTexture.CreateFromPrefilteredData(rootUrl + parsedData.environmentTexture, scene);
|
|
|
|
|
|
+ if (parsedData.environmentTextureType && parsedData.environmentTextureType === "BABYLON.HDRCubeTexture") {
|
|
|
|
+ var hdrSize:number = (parsedData.environmentTextureSize) ? parsedData.environmentTextureSize : 128;
|
|
|
|
+ var hdrTexture = new HDRCubeTexture(rootUrl + parsedData.environmentTexture, scene, hdrSize);
|
|
|
|
+ if (parsedData.environmentTextureRotationY) {
|
|
|
|
+ hdrTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
|
+ }
|
|
|
|
+ scene.environmentTexture = hdrTexture;
|
|
|
|
+ } else {
|
|
|
|
+ var cubeTexture = CubeTexture.CreateFromPrefilteredData(rootUrl + parsedData.environmentTexture, scene);
|
|
|
|
+ if (parsedData.environmentTextureRotationY) {
|
|
|
|
+ cubeTexture.rotationY = parsedData.environmentTextureRotationY;
|
|
|
|
+ }
|
|
|
|
+ scene.environmentTexture = cubeTexture;
|
|
|
|
+ }
|
|
if (parsedData.createDefaultSkybox === true) {
|
|
if (parsedData.createDefaultSkybox === true) {
|
|
var skyboxScale = (scene.activeCamera !== undefined && scene.activeCamera !== null) ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1000;
|
|
var skyboxScale = (scene.activeCamera !== undefined && scene.activeCamera !== null) ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1000;
|
|
var skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;
|
|
var skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;
|