Search Unity

Hybrid rendering V2 SRP batcher error

Discussion in 'Graphics for ECS' started by Deeo, May 2, 2021.

  1. Deeo

    Deeo

    Joined:
    Dec 6, 2012
    Posts:
    39
    Been trying to figure this out but no matter what material I try to use on a custom built mesh at runtime I get this error.

    A Hybrid Renderer V2 batch is using a pass from the shader "HDRP/Lit", which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.

    I tried turning off static batching for HDRP but that didn't work and any material seems to give this error. Any ideas what is causing this?
     
  2. Deeo

    Deeo

    Joined:
    Dec 6, 2012
    Posts:
    39
    Bump
     
  3. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    You can try selecting the HDRP/Lit shader and looking at the Inspector. It should contain an SRP Batcher compatibility status code and any related error messages.
     
  4. Deeo

    Deeo

    Joined:
    Dec 6, 2012
    Posts:
    39
    Ok found that and says it is not. The shaders from the Hybrid sample project say they are though and I have the newest Hybrid render package and the latest HDRP. Is there another package I'm missing to get the SRP Batcher compatible shaders?
     
  5. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    What might have happened is that there is some particular variant of the shader which is incompatible. If this is the case, then likely the sample project is not using that variant, and since the Unity Editor compiles the shader variants on demand, the variant is never loaded and doesn't cause compatibility issues. This has happened previously with some HDRP debug view shader variants.

    The Inspector view should hopefully give you the name of the property or constant buffer which is the source of the incompatibility, which should be helpful in tracking down what the problem is. Once that is known, it is likely you could modify the source locally to work around the issue.
     
  6. Deeo

    Deeo

    Joined:
    Dec 6, 2012
    Posts:
    39
    OK thank you, so I should be able to delete the variant then and it will recompile to be compatible I take it.