I’m looking for a way to replace the built-in “Standard” shader in Unity’s built-in materials for the built-in forward renderer (not URP/HDRP). I know that I can replace the material in each GameObject by hand, but I’m looking for a way to replace what Shader the builtin “Default-Material” is pointing to.
I hoped I could just create a new Shader, name it “Standard” and Unity would use this one over the builtin shader, but that doesn’t work in Unity 2019.4.20f1.
When I create a new GameObject, for example a Cube, Unity automatically assigns the “Default-Material” which uses the “Standard” Shader. We often use those primitives (Cube, Sphere, etc) for white-boxing or NavMesh helper objects. So we end up with the Standard shader being used and it causes a significant amount of time spend on shader compiling and stripping during a build.
Since we don’t use the actual Standard shader functionality, I want to replace it with a much simpler Shader to improve build times.
The defaults are in Assets/Universal RP/Runtime/Materials/ - you can change the shader that’s assigned to whichever (just open in the Inspector, pick a different one from the dropdown at the top). There might be a way to just pick different material reference entirely for defaults, but I don’t know it. Hope that helps
Edit: Basically whichever material it assigns when you create a Cube for example, just double-click that Material in the Renderer in the Inspector then pick a different shader. The next time you create a new object it also uses the newly-selected shader.
Actually, you did mention it: “I’m looking for a way to replace the built-in “Standard” shader in Unity’s built-in materials for the built-in forward renderer (not URP/HDRP)” …I’ve once again skimmed my way into offering useless advice
I would love to know that. Had to write a script to go through every single model in a project and replace the reference to the default material because Unity was adding a copy of the standard shader to each asset bundle.
Built-in Unity assets cannot be assigned to bundles in the built-in build pipeline, so if they are referenced by multiple bundles they will be duplicated. The scriptable build pipeline finally fixes that by assigning bundles to asset GUIDS instead of asset paths, but migrating to SBP is not viable for this project for several reasons.