Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Using Flatkit water with entities

Discussion in 'Graphics for ECS' started by instriker_911, Dec 13, 2022.

  1. instriker_911

    instriker_911

    Joined:
    Mar 31, 2022
    Posts:
    27
    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!
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    352
    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.
     
    instriker_911 likes this.
  3. instriker_911

    instriker_911

    Joined:
    Mar 31, 2022
    Posts:
    27
    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.
     
    JussiKnuuttila likes this.