Sign in to follow this  
JCPalmer

What is scene._environmentBRDFTexture?

Recommended Posts

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.

new_world.thumb.png.b0547307287afc2d64ccbafe731fe512.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

env-tex.thumb.JPG.ca4bcac9bc56c557033a9cc37445b5d3.JPG

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.

Share this post


Link to post
Share on other sites

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:

 

color_space.thumb.JPG.2c6899cc11c0980213ff1fdb835fc7c8.JPG

Should it be createFromPrefilteredData  when Non-Color Data?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.