I have been searching for an answer all over the internet and I can not seem to get one clear cut answer to this, is there a replacement for the Grab Pass that was removed from all the render pipelines other than the built in render pipeline. I’ve been told vague things like I’m looking for an Opaque texture, colour buffer, colour texture etc but NO information on where to find these things and how to use them. I have a cg shader that simulates rain dripping down a window and uses a grab pass to create effects like refraction and blur but i can NOT get this to run in HDRP…
The way to do this in render pipelines is to convert your shader to a shader graph and use the SceneColor or HDSceneColor (in HDRP) nodes. This can be done in a simple shader or in a custom pass shader as a post process for example.
There’s examples of this in the Water Sample in the HDRP Package Manager sample tab (under water scene). Transparent samples have some custom refraction samples as well using Shader Graph.
@CodeExplodeStudios indeed HDSceneColor is the way to go. It reads from the “color pyramid”, which is updated at two different points during the render pipeline (depending on what HDRP features you have enabled). I can drop some more info about where the color pyramid is updated if you wish.
Only thing to watch out for is this bug, which is still there after… a long time
I saw the status of the bug change to In Progress and felt a surge of hope, but it’s been stuck there for a few months.
Thank you for the reply, Does this have to be used via a shader graph? Can this not be sampled via hlsl code?
Thank you for your reply, can you sample the HDDceneColor via hlsl code? I have tried to convert my shader code to shader graph but it was a bit to hard for me to get working although I did get the first part of it converted until I got to the if statements, as a result I’m looking for a drop in replacement for the grab pass so this shader can become functional again, I would appreciate any additional information you can give me .
I’ll try to see what I can do but backports got stuck sometime and they aren’t a huge priority so it takes more time. The fix landed in 6000.1.0a9, the rest of the fixes are ready but haven’t landed yet.
One solution is to look at the generated shader from a shadergraph that uses the HDSceneColor node and copy past the function and includes in your own shader.
You can also look at the nodes implementation here.
Minus the defines and stuff, the magic function here is SampleCameraColor(uv, lod)
.
The fix has landed now in Unity 6 (starting 6000.0.35f1) and backport to 2022 is on its way too !
Thanks for your patience