Stop custom shader replacing texture

Hopefully a simple question, but I’m having trouble finding an answer elsewhere.

I’m currently learning Shader Graph and I’ve made my first 2 custom shaders.

When I assign my custom shader to an object which already has a shader, the currently assigned texture is removed from the object.

Is there a shader graph setting that allows me to keep the current material?

I assume it’s under Texture2D’s default, but I can only set it to ‘none (Texture)’, or a specific texture.

You can get around this by ensuring your texture input “Reference” names are the same, across all shaders.

For the standard lit URP shader this is “_BaseMap” for the albedo and “_BumpMap” for the normal map.

If you use the same names, when switching a material from a Lit shader, to a custom shader graph, the texture references will be kept.

1 Like

Many thanks!

I changed the Reference to “_BaseMap” in Shader Graph and everything works just like I want it to now.