Search code examples
androidarcoregltf

Scene Viewer: Is transparency supported?


I am using Scene Viewer (https://developers.google.com/ar/develop/java/scene-viewer) for displaying a model in AR.

the model has a transparent glass material, and it renders fine in any GLTF model viewer I've tried, but Scene Viewer itself seems to render the material opaque. at least that's what I can tell from a handful of screenshots android users have provided.

the validation report on https://modelviewer.dev/editor/ seems to be ok.

  • is transparency supported in Scene Viewer?
  • or does it potentially depend on the device, android version, or ARCore version?

EDIT:

to be more precise: the model format is GLTF 2.0 and it uses the KHR_materials_transmission extension. the glass material is one-sided and the alpha mode is BLEND.


Solution

  • Alpha Blending and Transmission are two different types of transparency – you can combine them, but it's usually unnecessary. Transmission is the newer and more advanced of the two, and it's quite possible that Scene Viewer doesn't support it yet. Alpha Blending is older and should work anywhere.

    To use either one separately, you can follow these steps. I'll use Blender's terminology, but hopefully the steps are similar in other software.

    Alpha Blend

    1. On a Principled BSDF material, set Alpha ModeAlpha Blend
    2. Set Alpha to a value <1, or connect the alpha channel of a base color texture.
    3. Export to glTF 2.0

    Transmission

    1. On a Principled BSDF material, set Alpha ModeOpaque
    2. Set Transmission to a value >0
    3. Set Metalness to 0
    4. Export to glTF 2.0