Hi all. Sorry I’m still fairly new to Unity. Thanks in advance for any help.
I’m using Unity 2019.2.8f1 and I created a blank project from LWRP template. Eventhough in “project settings”->“graphics” the rendering pipeline asset property (topmost property) is set to LWRP-HighQuality.asset (which is the default set there) when I call the code below it results to null. Am I missing something?
if (GraphicsSettings.renderPipelineAsset) sh = GraphicsSettings.renderPipelineAsset.defaultShader;
The breakpoint image is attached. And it’s running directly from Android phone, samsung s7 edge
Ok I finally solved my own problem. It seems the lit shader has no reference eventhough it’s actually referenced in the lwrp asset. So it is stripped from the build when running in an Android phone, i.e.
line 483 of LightweightRenderPipelineAsset.cs or any built-in lwrp asset has below that returns null
if (m_DefaultShader == null)
m_DefaultShader = Shader.Find(ShaderUtils.GetShaderPath(ShaderPathID.Lit));
return m_DefaultShader;
so to solve this,
I just added a material in Asset/Resources folder which reference the PBR Lit shader and m_DefaultShader is not null any more!
Hope this helps other people as well.

1 Like