How to get compiled shader?

Hi
Is there is a way I can get my external compiled shader at runtime or possibly through Unity Editor API? I’m working on a plugin for which I require Unity compiled shader version for my external shader.

I can see the compiled shader when hit “Compile and Show Code” in inspector for an external shader but is there is any way I can get the compiled shader at runtime or through Unity Editor API for plugin?

Haven’t tried this personally, but you can have a look at the code behind the button https://github.com/Unity-Technologies/UnityCsReference/blob/61f92bd79ae862c4465d35270f9d1d57befd1761/Editor/Mono/Inspector/ShaderInspector.cs#L345

1 Like