- Home /
OnRenderImage disable MRT(Multiple Render Targets)?
Hello,
I want to write specific value of objects to RenderTexture and use that value in ImageEffect later.
So, I wrote a shader for material of object. It has multi color output for multiple render targets.
Attached project is a small sample. It pick red value of objects and write it to RenderTexture.
Without OnRenderImage, it works fine. When objects are drawn, FrameDebugger shows RT0 and RT1, RT1 is written red color exactly.
But with OnRenderImage, RT1 disappear. When objects are drawn, FrameDebugger shows only RT0, and "RenderTarget" is "ImageEffects Temp", not RenderTexture I have specified.
And in OnRenderImage, RT0 and RT1 are perfect black.
With OnRenderImage, Camera.SetTargetBuffers is ignored and RT1 is not written?
Are there any good ways to write specific values to multiple render targets and use it in OnRenderImage?
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612072201im_/https://answers.unity.com/themes/thub/images/avi.jpg)