How to access the Custom Depth Stencil inside a global shader?

Hey, there!
I’m trying to modify Unreal’s TAA source code, and I need to access the Custom Depth Stencil buffer inside the shader itself. But I have no idea how to do that! Do I need to modify the .cpp code and link it to the shader somehow? Or is there a way to just access it directly inside the shader?

Thanks!

Bump! Still haven’t really figured this out. I’ll update this if I manage to find a solution.

any news?

Im interested on this too. Nobody knows the answer? Even if is not possible to discard this option?

Im looking a way to include/exclude objects from the shader. The first thing that comes to my mind is by stencil. Is there an other way?

Sorry for the delay guys, I haven’t opened the forums in a while. I figured out a way to do it, yes!

All I did was download and build Unreal from source and modify a couple of files in \Engine\Source\Runtime\Renderer. You can check the code in TemporalAA.cpp and backtrack from there. I’m a bit busy at this moment, but I’ll need to update the engine version and possibly redo all changes cause I screwed up version control lol, I can give more precise details once I get to that point!

Good luck!

Oh! yes please, that will help a lot!

Sorry for the delay!
There’s certainly a better way to share this, but I can’t make the repo public and I suck at git lmao, so hopefully this works.





1 Like