LoadAssetContainer does not add Refractions to materials from glb in Babylon 4.2.0

So I’ve been trying to troubleshoot an issue with refractions not transferring over from Blender → glb → Babylon (as I noted in this forum post: Is it possible to test models with previous versions of the babylon sandbox without having to find a specific commit and clone it from github? - #3 by johntdaly7), and so I made a playground that emulates the Babylon sandbox setup to narrow down the issue.

The playground can be found here:

The refraction shows up fine in the Babylon sandbox, but in my code it does not. I realized that it is because the Babylon sandbox uses ImportMesh() function to load in the model, whereas my code uses LoadAssetContainer(). It seems LoadAssetContainer strips the refraction data from the mesh/material upon load.

Is there a way to add in the refraction data in the LoadAssetContainer parameter function, or would it just be lost? I assume that this issue has been known, because this issue no longer exists with Babylon 5.0.0-alpha.40.

If I want to still use 4.2.0, would I still have the ability to use LoadAssetContainer for this purpose? Or would I have to use some other load function? I know we chose LoadAssetContainer for a particular reason, but I cannot remember specifically why. Is there any benefit for utilizing LoadAssetContainer over the other functions? I think it was because LoadAssetContainer returns “assets”, which is broken into meshes, transformNodes, textures, lights, cameras, animations, etc. What would be the next best alternative?

Thanks for the help!

I am glad it is all ok in 5.0 but unfortunately we will not port it back in 4.2 as there are too many things that could go wrong.

May I ask why not moving to 5.0 preview ?

cc @PirateJC who might be interested in the answer :slight_smile:

Oh I am not expecting to port it back to 4.2. I’m just wondering if there’s any code that can be written after the function is called or whatnot that would result in the refractions being added, while still using the LoadAssetContainer function. And if not, is there a function that returns an assets object that can break the model into objects like meshes, materials, textures, etc.? Thanks!

The main issue is everything related to transmission has changed in 5.0 so you would unfortunately need way more changes to the internals of PBR to achieve the same.

But in case you do not need all of it but basic refraction, you could after load introspect and change the materials in the container to make sure they are setup as you expect.