Using ShaderGraph to Sprite Renderer Throws [GPU deformation support] Error at Unity6

We were using Unity 2022 3.22f1(LTS) and everything worked well.
But after upgrading to Unity 6, custom-shadergraph sprite makes this warning.

  1. We are using URP.
  2. We checked our shader is SRP Batching compatible.
  3. But the error comes out from every single part of my character sprites.(ex : leftarm is using a shader without GPU deformation support. Switching the renderer over to CPU deformation.)
  4. So we assume if the base shadergraph type might be changed, and therefore we tested with the basic shader graph.
  5. Still making this error: which seems bug.
  6. Custom ShaderGraph-created Materials make error too : [Material ‘Character_Mat’ has _TexelSize / _ST texture properties which are not supported by 2D SRP Batcher. SRP batching will be disabled for 2D Renderers using this Material.”]

For make it more clear, i ran xcode gpu profiling, and the gpu time has increased about 20% more than before.

We decided to downgrade unity.
If this is not a bug, can somebody explain what is changed and what is happening?
If this is a bug, strongly hope this issue be fixed as soon as possible.

1 Like

Thanks for reporting this. Would you please be able to file a bug report?

Okay. I made an empty project to reproduce it, and i sent a bug report.

New Incident created: IN-92125 - Using ShaderGraph to Sprite Renderer Throws [GPU deformation support] Error at Unity6.

The error is related to GPU Skinning option i guess.

Please note that GPU Sprite deformation support is currently supported in the default shaders (Sprite-Lit-Default and Sprite-Unlit-Default).

To add support for custom shaders, please check the following macro in the shader:
UNITY_SKINNED_VERTEX_COMPUTE(v);
implemented in com.unity.render-pipelines.universal\Shaders\2D\Include\Core2D.hlsl

Add a multi_compile flag to the custom shader.
#pragma multi_compile _ SKINNED_SPRITE

We are currently working on adding support in ShaderGraph for custom shaders through adding a new node. Will post an update once its available.

Regarding Character_Mat material it seems the shader is using TexelSize property _MainTex_ST which is not compatible for 2D SRP-Batcher.

Batching for 2D is supported in multiple ways:

  1. SRP-Batcher (is default in URP-2D when enabled and falls back to Dynamic-Batching is either its disabled or shader does not support it).
  2. Dynamic-Batching (is default in Built-in pipeline and URP-2D when SRP-Batcher is off globally or for a particular shader).
  3. Instancing (If Shader supports it).

So in the case of Character_Mat it simply falls back to Dynamic-Batching and can be ignored. The warning is let known that the shader is not 2D SPR-Batcher compatible.

1 Like

Thanks for your well-explained answer.

We are currently working on adding support in ShaderGraph for custom shaders through adding a new node. Will post an update once its available.

It sounds very cool! My team is waiting for this new update. Do you have any link of load map or something that we can track the progress?

I see the three case you mentionned. But since i am a programmer who doesn’t have a deep knowledge of Unity Shader, i want to check this.

Following this link, Building a custom renderer for Unity - Draw Calls & Batching - Joe Fazzino
([The SRP Batcher] part)

CBUFFER_START(UnityPerDraw)
...variables
CBUFFER_END

we have used this way to the custom shader to make it to be supported by SRP Batching in Unity5 2022-2023 versions, and it worked without any debug message.
But in Unity 6, it seems not working as my bug report,
even though it is still written “srp batching compatible” on the custom shader in the hierarchy.
Is this an unofficial-hacky way which is not supposed to work?

If so, Do i have any solution to use TexelSize & _MainTex_ST property while applying SRP Batching?

Thanks again for your help sir.

It should be available soon. Will post an update to this thread.

SRP-Batcher support for 2D Renderers is implemented in a different code-path and has the following additional limitations.

  1. Shader cannot use TexelSize or Offset.
  2. Renderer cannot use any Mask-Interaction. (Should be None)
  3. If 2D Skinning is active, only Sprite-Lit-Default / Sprite-Unlit-Default is supported. (until ShaderGraph support lands or code is updated as I mentioned above.

Instead of using _MainTex_ST you could define a constant and pre-define the values if you already know the texture property.
NOTE: It is recommended to use SpriteAtlas when using Sprites unless there are specific needs such as using UV or _ST in the shader.

Thanks.

1 Like

Posted a simple sample to add Sprite GPU Skinning for custom shaders here :

1 Like