JCPalmer Posted November 14, 2018 Share Posted November 14, 2018 Well, the PR for adding isPBR as a parsed value for setting up a skybox is complete. But, I am currently working on the Javascript exporter, so I needed to looked up the constructor for a HDRCubeTexture, and I just saw the gammaSpace arg. This is to be false for PBR & true for STD. Think I need another PR to promote when the parse parameter is defined, so it can be used in both. Something like: 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 { 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); } I see that the cubeTexture route has gamma space, but depends on the file extension. For my exporters, just always going to force HDRCubeTexture route. Is this look right? Should I modify what's new again, or is the last entry still going to cover this? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2018 Share Posted November 14, 2018 It does Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.