Property (_BaseMap) already exists. Use SetTexture instead

I reworked one of my shaders to work with URP and now, for some reason I can’t figure out, every time any shader recompiles, I’m getting the following error:

“Property (_BaseMap) already exists. Use SetTexture instead”

I’ve scoured the shader and its #includes and can’t find any additional mentions of _BaseMap except for the one line in com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl, which doesn’t seem to be something that should be causing this error. I actually have no idea what this error is trying to say. Does anyone have any light to shed on this? Thanks!

Hi!

Did you got any solution?
I have the same problem with the (_MainTex), but should be the same source :slight_smile:

Thanks,
Regards, Matthias

Unfortunately, no. It still does it every time a shader recompiles. It’s really annoying. Doesn’t seem to be causing any problems that I can tell, but it still bothers me.

Same problem. I think the reason why its happening is we using custom material to render UI

I have the same error

Property (_MainTex) already exists. Use SetTexture instead.
(Filename: C:\buildslave\unity\build\Runtime/Shaders/ShaderPropertySheet.cpp Line: 508)

Comes up every time I start the editor, but the error has no more information so I have no idea what’s causing it.

It’s haunting me as well.
I am having 4 occurrences with no indication of where it’s coming from.
Anyone figure this out yet?
I think it’s something to do with the new SRP, but I am using the standard pipeline, so I am not sure why I am seeing it.

Same problem

Hi there!

The problem is the same, went trying to create a scrolling background (URP 7.3.1 and Unity 2019.4.13f1).
The background ain’t scrolling and the errors are fired.
BUT, using 2020.1.17f1 and URP 8.3.1, the background scrolling is working, and there are no errors :confused:

Material doesn't have a texture property '_BaseColor'
UnityEngine.Material:get_mainTextureOffset()
Material doesn't have a texture property '_BaseColor'
UnityEngine.Material:set_mainTextureOffset(Vector2)
Property (_BaseColor) already exists. Use SetTexture instead.
UnityEngine.Material:set_mainTextureOffset(Vector2)

[EDIT]
It’s definitely an URP issue for me. Updating to 7.5.1 to see if the issue remain.

[EDIT2] Problem has been fixed with the update to 7.5.1

I have the same issue, URP 10.2

Having 4 occurrences, as well …no clue as for the cause 2019.4 LTE, built-in RP

Using Unity 2020.3 and also having this issue. There’s no stack showing which files are the cause of the error.

same here , 2019.4.13

What GUI are you all using for your shaders?

The LitShader.GUI references _BaseMap and these errors look like GUI errors to me

I’m using uGui with DoozyUI

does that script make reference to _BaseMap ?

Does anyone have a solution for finding out what shader has caused this error?

I had the same error message when working with custom shader.
The thing is - my shader did not have _MainTex and yet, that was what eror message was telling me.
I had 4 textures and every time I tried to set these textures in material, I was getting this error with call stack pointing to my Material.SetTexture call - always on my last, 4th texture.

My shader and all my parameters and textures were valid.

What was invalid is the moment I called them - from inside of OnDrawGizmos callback.

Moving the code out of GUI callbacks solved the issue for me.

I hope this info will help if anyone else stumbles upon this error and has the same issue :slight_smile: I guess I got punished for being a lazy bastard who took a shortcut and abused GUI callback :wink:

I has the same error while starting the editor and in a shader using this property (_DetailsMap for me) I was declaring it twice in the Properties.
Removing the extra declaration fixed it for me.

1 Like

@IndyNarf That sounds like it’s worth checking, but I’m working on a project with hundreds of shaders - did you find a way to locate shaders with a duplicate property declaration? I don’t fancy going through them one at a time looking for dupes!

3 Likes

bump