ShaderGraph - Shader that can work as both Transparent and Opaque?

Is there a way to support both opaque and transparent rendering from a single ShaderGraph shader?

We need to duplicate all our shaders to have two different versions, one that renders as transparent and one that renders as opaque. The actual material settings do not seem to matter, only what has been set in the Graph Settings in the editor seems to matter.

Shader that always renders as Opaque, regardless of material settings:

Exactly the same shader that always renders as Transparent, regardless of material settings:

There’s no way to do this at present, no. Conceivably, when “Allow Material Override” is enabled in the target, we could generate MaterialX that uses parameters to change the opacity/opacityThreshold, but the mere presence of those inputs (even if set to 1/0) signals RealityKit to treat the shader as opaque/transparent for sorting purposes, so it probably wouldn’t work entirely the same. Alternately, we could generate different MaterialX variants and select between them, as we would like to do at some point for (a subset of) keywords. I’ll add a note to investigate further.

Are there any plans to support material override?

It’s on our list of features we’d like to support eventually, but we don’t have a timeline for it per se. Feel free to submit it as a request on our road map.