Using Flatkit water with entities

Hi,

I’m using the Flatkit shaders within my ECS project. It’s working well up to now, but now I’m trying to add the Flatkit water shader, but then I get the following error:

A BatchDrawCommand is using a pass from the shader “FlatKit/Water” that is not SRP Batcher compatible. Reason: “Material property is found in another cbuffer than “UnityPerMaterial”” (_FadeDistance)
This is not supported when rendering with a BatchRendererGroup (or Entities Graphics). MaterialID (0x5) MeshID (0x1CE) BatchID (0x1)

Did someone got this kind of error when using 3rd party shaders, and what would be the work around in a case like this?

Thank yoU!

Shaders need to be SRP Batcher compatible to work with Entities Graphics. If the 3rd party shader author has not written their shader to be compatible, you can try to fix it yourself, or give feedback to the 3rd party author and hope that they fix it.

In this case, the first thing I would try is see whether this _FadeDistance property could be easily moved inside the UnityPerMaterial constant buffer without otherwise disturbing the shader.

1 Like

FYI, in that case, after contacting the 3rd party owner on discord, they made me available a version of the shader that is compatible with Entities.

1 Like