Hi,
are you using the same shader provided in the documentation?
If so, here’s what doesn’t with HDRP:
It’s using this pragma, which adds the keyword PROCEDURAL_INSTANCING_ON to the shader, and will automatically call the setup() function at the beginning of the vertex stage.
#pragma instancing_options procedural:setup
And in this function, you can see it’s fetching positions from a StructuredBuffer to set the unity_ObjectToWorld and unity_WorldToObject matrices.
void setup()
{
#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
float4 data = positionBuffer[unity_InstanceID];
float rotation = data.w * data.w * _Time.y * 0.5f;
rotate2D(data.xz, rotation);
unity_ObjectToWorld._11_21_31_41 = float4(data.w, 0, 0, 0);
unity_ObjectToWorld._12_22_32_42 = float4(0, data.w, 0, 0);
unity_ObjectToWorld._13_23_33_43 = float4(0, 0, data.w, 0);
unity_ObjectToWorld._14_24_34_44 = float4(data.xyz, 1);
unity_WorldToObject = unity_ObjectToWorld;
unity_WorldToObject._14_24_34 *= -1;
unity_WorldToObject._11_22_33 = 1.0f / unity_WorldToObject._11_22_33;
#endif
}
In HDRP, you can access those matrices with Macros but they are read only.
So, what I’d suggest instead of overwriting those matrices, is to transform vertices from local to world.
It’s something I shall cover in more depth in a future post in the Shuriken Particles & Shader Graph thread.