Im trying to render multiple quads using Graphics.DrawMeshInstanced. It works fine with opaque materials but when I change the surface type to transparent it doesn’t render. (using HDRP btw)
Here are some screenshots demonstrating the issue. Note the cube above the quad using the same material.
Opaque:
Transparent:
Here is the code:
private void RenderClouds() {
cloudMaterial.SetFloat(cloudsWorldPosName, transform.position.y);
cloudMaterial.SetFloat(cloudsHeightName, cloudsHeight);
_offset = cloudsHeight / cloudsResolution / 2f;
var initPos = transform.position + (Vector3.up * (_offset * cloudsResolution / 2f));
for (var i = 0; i < cloudsResolution; i++) {
_cloudsPosMatrix = Matrix4x4.TRS(initPos - (Vector3.up * _offset * i), transform.rotation, transform.localScale);
_cloudMatrices.Add(_cloudsPosMatrix);
}
Graphics.DrawMeshInstanced(cloudMesh, 0, cloudMaterial, _cloudMatrices.ToArray(), cloudsResolution);
_cloudMatrices.Clear();
}
Is this a bug or am I missing something?
Thank you.