JCPalmer Posted November 5, 2018 Share Posted November 5, 2018 scene has a member, _environmentBRDFTexture, which is not referenced in the scene.ts, but it is public. Is this a typo? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 5, 2018 Author Share Posted November 5, 2018 While I still want to know what that is, I found it because I was looking at scene level environment texture. Is there functionality to cause a sky box to be added without actually creating the mesh yourself? Could this maybe be added, where the programmer is still responsible for the radius? Blender can do this, but I do not think it actually needs a box. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 5, 2018 Share Posted November 5, 2018 The environment BRDF is an internal property (hence the underscore) but used by several classes (PBR, engine) hence the public To create a good looking skybox, you can use the scene.createDefaultEnvironment(): http://doc.babylonjs.com/how_to/fast_build#create-default-environment Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 5, 2018 Author Share Posted November 5, 2018 Thanks. Something weird though, I cannot find "createDefaultEnvironment" in the scene.ts file. I tried the one in Github. Finally found it in sceneHelpers. I see EnvironmentHelper has no serialized options, or a parse method. That would mean the JSON exporter would not be able to set the option (overrides actually) of a default environment. Think I'll just try to see if environment texture through for now. Possibly add Blender custom properties later. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 5, 2018 Share Posted November 5, 2018 Yep this one is the good one: https://github.com/BabylonJS/Babylon.js/blob/c448c6d7d19569174b5732b0073509276e335931/src/Helpers/babylon.sceneHelpers.ts#L46 It will augment the scene when added (1st step towards engine modularization) Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2018 Author Share Posted November 9, 2018 Well, re-activating topic since I found new stuff. I am currently reading node trees now, and this what it looks like from Blender 2.79 / cycles. For .babylon (JSON), there is actually both facilities for environment textures & skybox right in babylonFileLoader.ts. Sorry, but I do not know what some of this stuff is. I just got this hiker cave file from https://hdrihaven.com/hdris/. blender works with this. Is this a BABYLON.HDRCubeTexture? If so, what is the hdrSize, an arbitrary number that is a power of 2, or the size of the texture? I an not sure how or if I can get a texture dimension from Blender. Next would be what is environmentTextureRotationY? Would anything need to be different when using PBR vs not? I hope not, since that is all that is serializable. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2018 Author Share Posted November 9, 2018 Ok, been playing some more, does it make sense that the equivalent of the HDRTexture vs createFromPrefilteredData in Blender / Cycles is the color_space parameter of the Environment Texture? In the picture above, it is set to Color, but here is the dropdownlist: Should it be createFromPrefilteredData when Non-Color Data? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2018 Author Share Posted November 9, 2018 Also, found that this code probably is not in use for the skybox part, anyway. The lines in FileLoader are: 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(undefined, true, skyboxScale, skyboxBlurLevel); } The environmentTexture arg for createDefaultSkybox is being check that is valid, which undefined is not: Scene.prototype.createDefaultSkybox = function(environmentTexture?: BaseTexture, pbr = false, scale = 1000, blur = 0, setGlobalEnvTexture = true): Nullable<Mesh> { if (!environmentTexture) { Tools.Warn("Can not create default skybox without environment texture."); return null; } Seems that scene.environmentTexture from a few lines above could be passed. hard coding pbr being true is unfortunate. Wish there was a parsed value for that. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 10, 2018 Share Posted November 10, 2018 well it is still possible to add that parsed value 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.