I am building a shiny milky sunglass by 3ds max with PBR material. I am using 3ds max babylon exporter to export the glb to babylon.js, is there anyway I can make a Frosted Glass effect like the picture below? Thanks!
Welcome aboard!
cc @PatrickRyan, who will be able to help you.
@justinsuen, you can create a PBR material that simulates a semi-translucent plastic substrate using the KHR Materials Transmission Extension to create a partial refraction of the environment. If you open this dragon test model for attenuation, you can experiment with the settings under the PBRMaterial for subsurface:
You will want to experiment with the roughness of the material and the intensity of the refraction to dial in the look you want. I would also suggest authoring textures for roughness (your original render looks fairly consistent in roughness so may just be a scalar) using noise to break up the surface a bit to reinforce the plastic feel as well as possibly authoring a thickness map to control your refraction intensity.
Unfortunately, our Max exporter does not have support for the transmission extension, and there are limited options to export using this extension outside Blender which is described in this Khronos blog.
You could also try importing your mesh and setting up your material in the sandbox before exporting to glTF directly from the sandbox. If you are just creating the asset to be shared as a glTF to be viewed in any renderer, you will need to export with the extension set up on the material. But be aware that just because a renderer supports glTF, there is no guarantee that they will support the transmission extension because it’s not in core glTF. Most of the main WebGL renders will support it, but it’s something to be aware of since it is an extension.
If you don’t want to use an extension, you could go with simple alpha blend on your material which is part of core and supported by all exporters. You will likely also want to use a thickness map to generate your alpha texture so that you have control over how opaque each part of your frame is. You will still need the same approach for your roughness. Alpha won’t give you any of the refraction qualities of the transmission extension, but if you are mainly concerned about showing the metal structure in the middle of your plastic rather than refracting the environment around the frame, then alpha will be cheaper. You will likely need to set depth prepass needed on your alpha materials to prevent sorting errors, but it can be a cheap alternative.
Hope this helps, but feel free to ping back with more questions.
Thank you so much for answer my question, I am new at using Babylon, how to build the opaquescence texture at refraction in sandobx…
About the roughness, I added roughness to the dragon and my model at the same time, look like the refraction texture is effective to the roughness, the dragon look very well, my model still clearly see my grandma underwear.
Also, I am setting my model from the sandbox, I know that lot of 3ds max setting are not supported, but anyway can output USDZ?
Thanks again for helpings me.
This texture is created automatically as soon as you use the KHR material transmission extension (which is the case with the Dragon model). It is generated by the rendering of all opaque meshes and used as a refraction texture for transmissive materials. You must therefore make sure that your model actually uses the extension.
Babylon now supports USDZ serialization, but I don’t think we can do it from the sandbox… cc @Deltakosh and @PatrickRyan.
We could think about adding the usdz export from the inspector