Make a URP renderer feature affect only the current camera

2.8k Views Asked by At

I'm making a renderer feature with a single ScriptableRenderPass. This renderer feature is present on a single 2D Renderer, like so:

inspector with 2d renderer

and I have a single camera that is using this renderer, that only affects a particular layer of the camera: inspector with camera using 2d renderer

The camera only renders everything on the PixelPerfect layer, ignoring anything else. This camera is in a camera stack, like so: camera stack

But, somehow, the renderer feature on Downscaled Camera affects the Background Camera - I suspect that the render pass somehow sees everything from the previous cameras, but I have no idea how that even makes sense, as when singling out only the downscaled camera, I only see the layer that I have set the Camera to cull.

Here's how the Downscaled Camera is set-up: downscaled camera properties

I'm Blitting to the renderingData.cameraData.renderer.cameraColorTarget in Execute. I've found this post on the GameDev StackExchange, but this was before the era of URP and scriptable renderer features, but it describes my problem perfectly. Any thoughts?

1

There are 1 best solutions below

0
On

I am having a similar issue where I have selected a custom renderer on my camera, but it refuses to use my custom renderer and only uses the default. I have yet to figure out why.

EDIT: For future reference, I fixed my problem. Turns out there was no problem. The scene view (and subsequently any camera previews for cameras you have selected) will always render with the default renderer. My render target was being rendered with the correct renderer.