Cross Pipeline shadergraph (HDRP+URP) breaks srp batcher

Hi! I am working on a game with cross pipeline (URP and HDRP). Tried new feature from shadergraph that can generate shader for URP and HDRP. Both version is 10.2.2.
When I choose 2 targets for shadergraph it is showing that srp batcher is not compatible.

It is super easy to test this behaviour:

  • Create new project with Unity 2020.2.1f1 and URP 10.2.2.

  • Download HDRP 10.2.2 in the same project.

  • Create new lit shadergraph through URP menus.

  • Add target HDRP

  • Add any property as in screenshoot.

6740758--776806--upload_2021-1-19_17-52-41.png

1 Like

I also tested SRP 11.x version and this bug is still there.

To link the same threads together here is links: SRP Batcher, Not Initialized()

Any news about it?

I have also encountered the issue, but the error message for me is different:
6753097--778999--upload_2021-1-22_10-13-33.png

I suppose the HDRP and URP passes have a different UnityPerMaterial definition and it disables SRP batcher, even though those passes will never be used together in the same frame.

1 Like

What is strange for me that no one answering about this question and still I see that feature is marked as released from version 9 to version 11 (the newest one with Unity 2021). So it makes me think that maybe I do something wrong? Like when you forget to enable toggle from camera for specific effect because it was disabled by default for some reason.

Was a bug report ever raised for this? We appreciate bug posts here but in my opinion, bug reports via the process outlined at Unity QA: Building quality with passion will get more immediate action.

Yes, I did and I see that QA team also added this bug to issue tracker today: https://issuetracker.unity3d.com/issues/srp-batcher-on-the-shader-graph-with-hdrp-and-universal-targets-is-not-compatible-when-hdrp-package-was-installed-after-urp
Great to see that someone looked at this problem:)

I also reported case #1309114

So I just tested what QA wrote in description and it seems working if you first install HDRP and then URP. If you do it backwards it is showing this error.
The question is how it is this possible? Can I fix my project somehow while we are waiting for bug resolving?

@alexvector Did you experience the same? I mean you installed hdrp onto urp or your case is different?

So this case cannot be fast fixed as I see. I tested what was in the description on issue tracker but it worked only because you also need to set a URP asset not only for the Graphics tab but also for the Quality settings. When I did it immediately show the same error message. It is actually great to see that the order does not matter but it is sad that we do not have any fast fixes then.

Any news about this bug?

We also need this fixed.
I found a work-around, just delete the HDRP target in the graphs before building a URP build, but this is super un-convenient for a build pipeline workflow and in general.

Is there maybe a way to open a shadergraph in the editor and to remove targets via script? This would be easy to add to the build-pipeline procedure.

The good news is that Jason made surface shader that works in this situation.
https://assetstore.unity.com/packages/tools/visual-scripting/better-shaders-standard-urp-hdrp-187838
https://assetstore.unity.com/packages/vfx/shaders/better-lit-shader-189232
You will need to modify his importer so you can work with two targets in one project but it is only acceptable solution I know for now.

That looks awesome but can’t update now all shaders to this tool-set.