SRP batcher warnings for SpriteRenderers with URP Lit shader

After updating our project to Unity 6, we have been getting this warning for a bunch:

Material ‘Painting’ has _TexelSize / _ST texture properties which are not supported by 2D SRP Batcher. SRP batching will be disabled for 2D Renderers using this Material.”

What triggers this warning is if we have a SpriteRenderer with a material assigned to it using the URP Lit shader. If we have those in the scene, we get the warning every time we enter play mode, exit play mode, or save the scene.

We don’t have very many of those SpriteRenderers around (the game is mostly 3D), but our level artists have used them here and there for things like posters and whatnot. Using a SpriteRenderer instead of a Quad takes less work.

Is this workflow now considered wrong, or is the warning message just overeager when it’s not needed?

10 Likes

I’m having the same issue after updating. In the frame debugger, it seems like batching is still happening, so this warning is probably a bug.

Also running into this issue after following this tutorial. Was on Unity 6000.0.23f1, now on 6000.0.25f1 and still running into the issue. Haven’t looked deep into it yet though.

Still an issue in 6000.0.25f1. It’s really annoying that it keeps spamming the console.

2 Likes

This is happening for me as well on 6000.0.25f1 with a Universal Render Pipeline/Unit Material.

2 Likes

I’ve had a similar issue with the Lit shader while using debug tools. Fixed it by reimporting the Shaders folder in my URP package.

Did you report a bug for this? I found another thread where this was reported as a bug but got marked as “fixed” with the following Resolution Note:

By design, 2D SRP-Batcher does not support access of TexelSize property in Shader. The Custom Node in the project does that and uses SRP-Batcher to render the Sprite. To fix, either please disable SRP-Batcher for that shader or add a custom node to set TexelSize within graph.

You can simply a Vector4 MainTex_TexelSize to the ShaderGraph which also automatically populates the required value and fix the issue.

It seems ridiculous because this is not an issue in 2022 versions of unity.

2 Likes

I have reported a bug, which got a different ID, IN-87691

That first got closed with the same kind of “you have to fix your assets” message, but when I followed up saying that this is an issue that’s a) not from our assets, but from builtin components, and b) has a really bad warning message, I got back:

Hi, After I consulted with the developers, we agreed that this issue should be addressed, i will be confirming this case

So it’s currently marked as “In Review”, but I don’t actually know what they’ll end up doing. At the very least it’d be great if the objects in the scene that trigger this is included in the warning instead of the warning just mentioning a material and us having to search for uses of that material on SpriteRenderers.

5 Likes

Hm I searched for IN-87691 in the issue tracker but don’t see it. Good luck with it and thanks for reporting it.

For my project I realized I could just adjust the textures in my Sprite Renderer and use the Sprites-Default material. I lose some batching but it isn’t a big hit. For a project that really needs the Lit material or the extra batching this fix is probably needed.

Got an actual external ID as well now; Unity Issue Tracker - Repeated warnings appear when applying Lit Material to "SpriteRenderer" in 3D project

3 Likes

Nice work pushing this. I voted on it, thanks!

1 Like

Issue tracker says fixed in 6000.0.32f1, but it’s still happening to me after updating

Still happening in Unity 6000.0.40f1

Same Warning:

Material ‘Outline-Material-White’ has _TexelSize / _ST texture properties which are not supported by 2D SRP Batcher. SRP batching will be disabled for 2D Renderers using this Material.”

I Updated from Unity 2022.3 LST to Unity 6000.0.40f1 today.

1 Like

Almost a month later and still happening

What they said in the bug report is that the warning will still appear, but only the first time you add the material or change the shader, not every single domain reload and scene open/close/save. I haven’t seen these warnings for a while for any old assets.

When I updated to 6000.0.47, the frequency of the warnings decreased but my framerate in the editor when the game was running also decreased by about 10x. I guess I’ll have to revert back to an older version

I’m getting these errors on my custom shader that I just imported from a Unity 2021 project into a Unity 6.1 project. The shader is a simple 2d sprite outlining shader that uses _MainTex, makes it solid, copies it a few times with offsets and recombining and such. I saw someone mentioning that there’s a new node that I should be using instead of _MainTex? I’m having a hard time finding any documentation discussing this, though. Are you aware of such a change, or can you point me to where I should look for such documentation?

Thanks!

EDIT: I believe I figured it out. I simply had to go into the _MainTex parameter’s properties and uncheck “Use Tiling and Offset”. Surprisingly, it seems that I can leave “Use TexelSize” enabled.

1 Like