2
$\begingroup$

I am trying to export a glass material in gltf. Here is the material principled shader, notice I have transmission set to 1.0:

principled shader

this gives me this result in cycles (the glasses have the glass material):

van with glass

However when I export this to gltf, and view it in the gltf viewer or load it in my webgl application, this is the result:

webgl van

How do I export glass?

I already have this in my render options:

render transparency

I am using blender 2.8 beta, all the other questions I could find all refer to an older version of blender.

EDIT: I don't even have the Blend Mode dropdown in my shader settings:

shader settings

$\endgroup$
0
$\begingroup$

glTF 2.0 has an alpha blending mode available, but it's intent is just to be "coverage" (like medical gauze tape), not a physically correct optical translucency (as the latter was considered too high a target for the initial release of 2.0). Basically this means that low alpha values will dissolve the entire material, including specular reflections. Even so, the mode is often used to emulate clear materials like glass.

To control the blend mode, look for a settings panel near the bottom of the material properties set of panels. Blender offers many choices here. glTF supports three of them: Opaque, Alpha Blend, and Alpha Clip (along with the "Clip Threshold" value in that case).

The alpha values can come from an RGBA "Base Color" texture assigned to the Principled BSDF node. If no texture is assigned, you can use the color picker on the Base Color disconnected input itself, and note the color picker there includes an alpha slider.

Blend Mode

For folks looking for a more advanced, physically plausible optical translucency, take a look at a glTF extension called ADOBE_materials_thin_transparency. Adobe submitted this in support of the translucency available in Adobe Dimension, and Microsoft worked with them to add support to BabylonJS. But, not many other glTF viewers have added support for this yet, outside of Dimension and Babylon.

$\endgroup$
  • $\begingroup$ Thanks for the insight! However I am not finding the Blend Mode setting, I even downloaded the latest beta right now, do I need to do something specific? i.imgur.com/dzoTVVa.png $\endgroup$ – Pontiacks Jan 25 at 22:32
  • $\begingroup$ Hmm, it's there when Eevee is selected as the rendering engine (in the Scene tab), but when I switch to Cycles, these options disappear. This might need to be filed as an exporter issue, not accounting for blend modes in Cycles. I guess the workaround would be to temporarily switch to Eevee to edit the material settings. $\endgroup$ – emackey Jan 28 at 15:28
  • $\begingroup$ Ok, I've been able to make the material transparent also, in eevee, following this guide, however the gltf export still exports an opaque material. Should I report this bug to the blender issue tracker? blender.stackexchange.com/questions/81851/… $\endgroup$ – Pontiacks Feb 10 at 18:36
  • $\begingroup$ When you switched to Eevee, did you find the "blend mode" -> "alpha blend" setting on the material, similar to the screenshot above? This, plus an alpha channel in the base color texture, should cause the current exporter to ask for blending in glTF. If you still need to file an issue, the tracker is here: github.com/KhronosGroup/glTF-Blender-IO/issues $\endgroup$ – emackey Feb 11 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.