Hi,
I have a little bit of a conundrum. Essentially I want to apply a shader to only a few particular sprites, but I need to apply it to all of them at once, not just individually. The way to do this is normally render targets but in this instance it seems impossible to use them. Here is the code and a more in depth run down below:
currentMap.DrawBackground(spriteBatch, currentRoom, camera);
currentMap.DrawMiddleground(spriteBatch, currentRoom, camera);
// Shader applied to this bit :
foreach (Character character in entities)
{
character.Draw(spriteBatch, camera);
}
currentMap.DrawForeground(spriteBatch, currentRoom, camera);
//------------------------------------------
base.Draw(spriteBatch);
Using render targets seems impossible as I would need to switch render targets which will wipe the stuff drawn before getting here, which I don’t want. I could stop it from wiping, but that is slow and I want to try to avoid that. I don’t really want to flush what I have already drawn to the screen as I apply some post processing shaders to the entire game. It seems like an impossible puzzle.
Am I missing something?
Thanks