SetReplacementShader alternative solution for HDRP

I’m trying to port a solution that used SetReplacementShader to get custom secondary render passes, to HDRP. As far as I could tell, the method is no longer available in SRP.

What I’m trying to do is basically this:

Optical flow is a bit of a different problem, but basically I would need a replacement shader for a secondary cameras.

I’m not sure what you need to do, but couldn’t you just write an image effect if you need to see that data on the screen? Although you probably need that replacement shader (or similar thing) to write out those categories etc.

I’m probably shooting in the dark but have you checked that custom pass repo:
https://github.com/alelievr/HDRP-Custom-Passes

There might be some useful pointers to the right direction. I haven’t yet had time to check those properly so I’m just guessing, but there’s examples of isolated effects etc. so it might be possible to use those techniques. But someone more knowledgeable might be able to help.

Exactly, as you write, I need this to be rendered and written to disc with all of those options for the same exact scene in a single frame from multiple cameras (or one camera that would iterate between different ‘options’). Some passes, like the segmentation, can’t have AA as well.
I’ll take a look at the custom passes repo. Thanks!

Hi custom pass is indeed what you need.
In the future we will add the option to export custom pass with our AOV request API to do what you describe, but it is not available for now, should be in 2020.1

Once HDRP stabilizes (which should be soon, right?) can we get docs about these things?

At this point the best way to figure out how to write custom passes is to study these : GitHub - alelievr/HDRP-Custom-Passes: A bunch of custom passes made for HDRP which is fine, but clear docs would help too :slight_smile:

Hey, note that there is already a doc for custom passes on the official HDRP documentation website: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.1/manual/Custom-Pass.html

3 Likes