Glass Material PBR Effect

Hello Guys,

I have a model that contains a glass material, i tried to achieve the glass effect by importing the model to sandbox and enabling refraction in the subsurface and tweaking a little bit of settings then exporting it, the effect is achieved but the file size is jumping from 1.7 MB to 111 MB, and to 5MB after compressing, the thing is i noticed that sandbox is adding a “opaqueSceneTexture” which is the reason of achieving this effect, i need to know how to generate that through the scene please, i attached the result that i want to achieve through the scene code and not sandbox

Best Regards.

What format are you using ? as I think the easiest is to add those extra info in the file manually.

2 Likes

I agree with the above and would also recom to simply create and replace mat in BJS.

Thank you for the replies, the model format is .glb, so what do you mean by adding those info in the file, through 3ds max for example ?

I think @sebavan (and then, me :wink:) are simply suggesting to create a new material in BJS and assign it to the mesh(es). Else, change some parameters on the original material (through script) before exporting. Point is, for whatever you have been doing through the sandbox (and next likely click on export for scene or mesh), you must have made alterations to the entire scene or model (at least, I assume so giving the numbers you are sharing).

“opaqueSceneTexture” is added by the gltf extension KHR_materials_transmission.
It is fully automatic, just import the glb file with the glass material, no extra coding is needed.

If you want to use this feature without importing a glb file, you need to use the TransmissionHelper.

However, it is located in the source code and is not available to users.

Thank you for the reply i will try that :smiley: