How can I create translucent materials with glTF?

I attempted to test the translucency of a model, first by creating an alpha map in jpeg and then applying it into blender. However when I attempted to test it on the online GLTF viewer (Dom McCurdy’s), it appears to be a solid object. Any help on how I can create translucency? Thank you!

Can you please share the glTF asset in this topic?

Also refer to the Blender docs. Not all configurations of Blender materials can be exported. The model above looks like it may be using “Alpha Hash” mode, too, and you probably want “Alpha Blend”.

https://docs.blender.org/manual/en/2.83/addons/import_export/scene_gltf2.html

Opacity_Box.glb (25.9 KB) Hey, here you go

The unexciting answer is that the glTF file does not contain any transparency, it’s opaque. You’ll need to change your settings in Blender to fix that:

Tried using Alpha Blend, but I’m getting a rather strange output. The box is not necessarily transparent, but I can see the inside of it. Furthermore when I rotate to see the sphere behind it, the sphere looks like it gets cut through?

Box.glb (26.0 KB)

You’ll need to set it to Alpha Blend, turn the “alpha” value to something < 1, and (if you don’t want to see the inside of the cube) enable backface culling, too:

Screen Shot 2020-08-18 at 6.53.29 PM

1 Like

This seems to be getting me an opaque box in the GLTF viewer instead. Am I missing some sort of unique setting in the export? What I get in GLTF viewer vs what I see in Blender.

image

Thats very strange because I did change the settings, yet it is still exporting as an opaque object?

I’m not sure why that would be. :confused: What version of Blender is this? And do you get the same result opening the model on https://gltf-viewer.donmccurdy.com/? If you can share the .blend that may help.

Yes, the first image from the last message I sent is from that GLTF viewer link. Here is the .blend Opacity test.blend (739.7 KB)

Hm, exporting that .blend works for me (without any changes). I’m using Blender 2.90 Beta.

I am using 2.83. Could that be the reason why? Also just to be clear, that is the GLTF viewer, right? Could you also send an image of your export settings if its not too much trouble? Thank you for your help!

I didn’t change any settings, so yes I think it’s a bug in that version of Blender. You can upgrade, or try bringing down the alpha (A) slider on the “Base color” socket instead:

Screen Shot 2020-08-18 at 9.52.56 PM

That was used before the alpha socket was added to Blender.

(Related: https://github.com/KhronosGroup/glTF-Blender-IO/pull/1106)

Okay, I will try these out and see if these work. Thank you!

you can try transmission: https://t.co/1Sq3E6gxPI

not perfect because it isn’t affected by surface roughness but i think it can look pretty good still.

^Note that transmission export won’t work until Blender 2.91. I think the cause here is just the version of Blender, they added an alpha socket to the principled material and it took another release for the glTF export addon to catch up.