Blender 2.8 Transparent GLTF/GLB

blender2-80

(S181) #1

Does anyone have experience with successfully exporting transparent materials from Blender 2.8?

I’ve read on various forums that this should be possible however, I’ve tried several different material configurations in Eevee and have had no luck yet.

Any ideas welcomed. Thank you.


(warnotte) #2

Did you change blend mode ?

(edit : and remove show backface also)


(warnotte) #3

you should have something like this at the end


(S181) #4

Thanks Warnotte. That works in Blender however it appears opaque when exported as a .gltf/.glb

Have you tried exporting it as a .gltf from Blender?

Thanks


(warnotte) #5

No i din’t tried. Are you sure, the viewer you use for glb/gltf has the ability to display transparent and so on ?


(S181) #6

I’ve tested it in https://gltf-viewer.donmccurdy.com/ and https://sandbox.babylonjs.com/ both of which support transparency I believe. After some research it seems I need to be working with the alpha channels…


(Don McCurdy) #7

You’ll want a Principled BSDF material using an alpha channel and either the “Alpha Blend” or “Alpha Clip” blending mode enabled. That exports correctly for me in a recent Blender 2.8 beta:

glTF currently supports a subset of the Principled BSDF values:

  • Base Color
  • Metallic (B channel)
  • Roughness (G channel)
  • Normal
  • Tangent
  • Blend Mode (Opaque, Alpha Blend, Alpha Clip)

Documentation in progress: https://developer.blender.org/D4082


(S181) #8

Hi Don, Thank you for your reply. Could you please send a screenshot of the node graph you’re using? I’m not having much luck.


(Don McCurdy) #9

Only the Principled BSDF node is needed, but you’ll also want to set Alpha Blend mode in the material settings sidebar, per screenshot above.

The opacity shown in the Blender viewport seems to be independent of the alpha value, but the alpha value will be exported correctly. I’m not sure if that’s a bug in the 2.8 beta or something else. Per https://developer.blender.org/T52189, this is a current limitation in Blender.


(S181) #10

I’ve used just the Principled BSDF and Material Output nodes and can’t understand why this won’t work. The transparency appears in Additive Blend Mode but not in Blend or Clip.

I’ve attached the .blend file.

transparency-test.blend (698.1 KB)


(Don McCurdy) #11

Hm, the model you attached does not show transparency in the Blender viewport, but when I export (from a recent 2.8 beta) it does look correct:


(S181) #12

In that case I’m thinking it has to be that my export settings are incorrect or my version of Blender is causing the issue. I’m on version 2.80 2018-11-30.

I’ve tried various export settings for both .gltf and .glb. I’ve attached the latest unsuccessful attempts. Ideally I’d like to export as .glb.


(Don McCurdy) #13

Oh, yes the latest Blender 2.8 beta has a lot of updates since November — I’d suggest trying to reinstall it.

In particular I think this issue was fixed in December: https://github.com/KhronosGroup/glTF-Blender-IO/issues/105.


(S181) #14

Success! That was indeed the issue. As soon as I used a later version of Blender 2.8 it worked. Thank you