Hello, I’m converting an old image effect created for the built-in pipeline to the new URP pipeline. I plan to support the new RenderGraph API only.
The effect I’m replicating is using the color and depth textures. I was able to replicate part of the original shader using ShaderGraph (the goal is to draw an occluders texture based on depth), however I need to add a second pass to the shader and AFAIK it isn’t possible with ShaderGraph.
For this reason I’m rewriting the shader without SG but I am not sure about certain points:
- How to properly access color and depth texture inside the shader?
If I understood correctly I need to declare that I want to use them in my AddRenderPasses method using ConfigureInput, is that correct?
What’s the correct way to retrieve them in the shader?
Also, on line 88 of the comment provided by Unity:
Is depth supposed to include DeclareDepthTexture.hlsl instead of DeclareNormalsTexture.hlsl?
- What’s the correct way to store this texture in a temporary render texture that will need to be passed to another material?
I assume I need to do this in the RecordRenderGraph method, but what’s the correct approach? Other examples I saw make use of cmd.GetTemporaryRT. What’s the correct way to get and dispose a temporary rt using RenderGraph?
Sorry for the newbie question, I’m trying to learn.
Thanks in advance!
