I'm building a 2D editor at the moment (using Monogame) and was wondering about the best way to blend render targets.
Each scene in the engine is composed of three layers, background, central and foreground... that way I can add objects to a particular layer, apply the effects and lighting I want on said layer without affecting objects in other layers.
Until recently I've been using a single render target to draw the scene (and a light map render target, blending the two together using a simple shader), but since I want lights to take affect in their assigned layer (not across the entire scene) I'm going to have to use separate render targets for each layer, and do a lighting pass for each one.
So at the end of this I'm going to be left with three render targets (lighting + objects in the layer) that I need to apply any post processing effects to, and then blend in to the final scene... and was wondering about the best way to go about this. I assume the only way to really do this is using a pixel shader (to sample each render target and blend the result), but wanted to get suggestions before I go ahead with this.
Also, is this complete overkill? I've not really built a 2D rendering system before, so I'm kind of winging it. I intend to add dynamic shadows on a per-layer basis as well.
Thanks for the help!
Edited by Orangeatang, 20 April 2013 - 05:46 AM.