I’ve been able to GPU instance shader properties like Color or Saturation using the Unity docs on GPU Instancing: Unity - Manual: GPU instancing
However I am looking for help on how to GPU Instance the _MainTex’s Tiling & Offset parameters, in a material I see them as serialized as:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}```
Can anyone advise on how I can setup a super simple shader where I am able to GPU Instance these properties or add new ones to replicate them so when I apply a MaterialPropertyBlock to override tiling or offset I do not break batching?
The m_Scale and m_Offset serialized properties are converted at runtime into the float4 _TexName_ST; and applied with a TRANSFORM_TEX(uv, _TexName) macro in the shader. That macro looks like this: #define TRANSFORM_TEX(tex,name) (tex.xy * name##_ST.xy + name##_ST.zw)
If you want to include the same functionality, you need to not use the built in tiling / offset options the material exposes (I’d recommend putting a [NoScaleOffset] in front of the texture property in your shader to hide those options) and use your own Vector/float4 value to do the same thing.