Multiple Render Targets in URP

I’m trying to create a multiple render target shader in the most recent version of URP, based on this simple example: GitHub - keijiro/UnityMrtTest: A simple example of MRT (multi render targets) with Unity

In the built-in render pipeline it works as intended as shown in the git repository, but when switching to URP it simply does nothing - no errors.
I haven’t been able find any examples or documentation on MRTs in the Universal RP - does URP actually support this?

See URP postprocess part, especially the gaussian blur. It uses 2 render targets.

I have the same question. And did take a look at the URP postprocess.

the shader part is simple enough, but I don’t want the post processing, but I would like normal rendering happening to two rendering targets. In order to set that up do I have to use command buffer?

I want to write to screen buffer and my other custom rendertexture at the same time using mrt

As far as I know, command buffer is the way to do it. CommandBuffer.SetRenderTarget accepts an array of RenderTargetIdentifier. Each array element should correspond with the output buffer in shader.
It should be easy enough to test it by creating custom scriptable render pass and rendering it to multiple textures.

1 Like

I just tried to set MRT for a camera using the 2DRenderer. This can’t be done since the engine (I guess the render pipeline) calls SetRenderTargets internally replacing my color buffers with _CameraColorTexture before rendering. I would have to search for the code that manages that in the package and change it. I’m not sure if I’ve enough will to do so.

For whom looking for the implementation of MRT, I put up my scripts in this link: Resolved - How to have Multi Render Targets in renderer feature - Unity Forum
Though it shows a meaningless sample case, it does work as expected.
(I am still a newbie, so Sorry if I have misunderstood anything)