1
$\begingroup$

I need to export a glTF model with a material that uses the KHR_materials_unlit extension. This is a simple faked shadow, and so I need the material to use an image with an alpha texture on it.

The 2.8 manual suggested to use a Background material to get KHR_materials_unlit, but that does not support alpha: screenshot of shader graph editor, showing the Background node has only a Color input

The latest manual has a more complicated suggestion, but again the solution has no mechanism to support alpha:

To export an unlit material, mix in a camera ray, and avoid using the Principled BSDF node.

$\endgroup$
2
  • 2
    $\begingroup$ For reference, this is what the exporter expects. $\endgroup$
    – scurest
    Nov 17, 2022 at 19:24
  • $\begingroup$ @scurest Thanks! That's...frustratingly cumbersome. I hope future Blender can improve on this to make it simpler to turn off shading without creating complex shader graphs for each material. $\endgroup$
    – Phrogz
    Nov 17, 2022 at 23:00

1 Answer 1

1
$\begingroup$

This seems to work and is pretty simple, using a Mix Shader surface for the material, with the Fac set to the alpha of the image, the first Shader set to a Transparent BSDF, and the second Shader set to the color of the image: screenshot of the Shader Graph Editor showing what is described above

This is similar to, but simpler than, what Blender creates if you hand-edit a glTF file to use KHR_materials_unlit with an alpha material and then import that glTF into Blender: complex shader set up by Blender for simple unlit texture

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .