Custom shader is throwing Non shader graph shader Warning

Hey,

I created a custom shader that works fine in the simulator when I place the object in the scene(it also works when I Instantiate it). But our app uses a custom state machine to spawn objects that doesn’t work with my custom shader but it works with default URP/Lit shader. It basically shows Magenta color on the objects.

I get lot of below errors.
[Diagnostics] Warning: Non shader graph shader ‘XXXXXX’ not supported or MaterialX encoding missing

Below is my shader logic.

Thanks!

This often happens when the shader graph fails to import (and thus be converted to MaterialX). The first thing I would try is to reimport the shader graph. If that doesn’t work, please submit a bug report with a repro project and let us know the incident number (IN-#####) so that we can investigate.

Another thing to keep in mind, in case you’re trying to load shaders from asset bundles, is that currently all shader graphs have to be in the base build; we can’t load MaterialX representations from asset bundles at the moment.

After some digging, if I reference shader via inspector I can’t load a shader but I can do it with Shader.Find() method.

When you say asset bundles, can we still load shaders via Addresables?! I know the support was added in 0.7

AFAIK, addressables are just an additional layer on top of asset bundles, so any limitations that apply to asset bundles will apply to addressables as well. In both cases, you can’t load any new shaders for use in visionOS MR mode; all shaders must be present in the base build.