OilPaintEffect using RenderPass - From RenderTargetHandle to RTHandle

Hey there,

First thing first, I’m not sure if my thread is in the correct section, so feel free to tell me if I was wrong.

I’m learning SRP, Render passes and Shaders and I’m trying to make a Painterly / Oil Paint Render pass.
I’ve found this awesome tutorial: here

And everything works until the very end where we had the DepthOnlyPass before our own RenderPass.
In the tutorial, it showcases the code with the deprecated RenderTargetIdentifier, RenderTargetHandle and RenderTexture. I searched a lot about the conversion with the RTHandle workflow but I can’t figure out how to do it properly. I tried to follow the first steps of this thread solutions but it didn’t work for me.

I got the effect to work properly by removing the EnqueuePass of the DepthOnlyPass. The effect looks great but as a consequence there is no depth. I also keep getting spam of Warnings due to the Blit using the deprecated stuff but the major issue is that the Setup method of the DepthOnlyPass doesn’t allow a deprecated argument and asks for a RTHandle variable. I then tried to create my depthTexture that is required in the method i talked about before using this line in the override Create() method of the ScriptableRendererFeature

depthTexture = RTHandles.Alloc("_CameraDepthTexture", name: "_CameraDepthTexture");

As I said, by removing the EnqueuePass I kept the Setup of the DepthOnlyPass and I get the following warning:
CommandBuffer: temporary render texture _CameraDepthTexture not found while executing (SetRenderTarget depth buffer)

So i’m pretty sure there is something wrong with my Alloc or I am missing a point.

I came on the forum to try to figure out how to convert all the deprecated workflow to the new RTHandle one because I’m quite lost to be honest.

Lastly, my code is exactly the code from the tutorial from above, the only change I made concerns the depthTexture variable of type RTHandle sent to the DepthOnlyPass.Setup method.

Feel free to ask any question if you need more information about my problem,
Thanks in advance,
Padrox

2 Likes

Anyone ?