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
I think @sebavan (and then, me ) 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.