URP Scriptable Render Pass - Will temp render texture persist indefinitely?

Hello World!

I’ve implemented a Fog Of War shader that takes two inputs: 1) the current FogOfWar and 2) the current FieldOfView, and it bangs both inputs together to produce a new and updated FogOfWar texture. I would like my FogOfWar ScriptableRendererFeature to create and hold on to the same texture I’m outputting so that it can be used at the beginning of the next pass as the Fog Of War input. Would it be possible to do this by creating the texture in the Create or AddRenderPasses methods, and saving it as a private variable that can be used during blitting?

Thanks in advance!

Anthony

yes, it’s a common practice, you can create an RTHandle there and reuse it for the next frames.

Oooooh thanks for this!! Would you happen to have a link to any examples of this being done, or point me in the right direction? I’d love to see a sample to make sure I’m setting everything up right.

Thanks so much!

Anthony