Might be a good idea, thanks!
I’ll try this asap, and post the fps improvement with drawstring() in the other thread.
Edit: Can I somehow apply the shader before scaling? The effect is still the same if draw the small rendertarget (scale = 4) in a spritebatch using the shader as a parameter. My current code is something like this:
Assets.Graphics.GraphicsDevice.SetRenderTarget(rt); Assets.Graphics.GraphicsDevice.Clear(Color.Transparent); Assets.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise, null);
// Write text to rendertarget
Assets.SpriteBatch.End(); Assets.Graphics.GraphicsDevice.SetRenderTarget(null); Assets.Graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
// Other stuff, world drawing
Assets.SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise, fontOutlineShader); // Apply shader Assets.SpriteBatch.Draw(rt, Vector2.Zero, Color.White); // Draw rendertarget (or draw a downscaled version at scale = 4) Assets.SpriteBatch.End();
// UI drawing (mouse etc)