all public facing renderer functions take an RT

sprites
cosmonaut 2020-12-04 15:49:35 -08:00
parent 56cdffdff6
commit 665ff6dd44
1 changed files with 2 additions and 2 deletions

View File

@ -178,6 +178,7 @@ namespace Kav
} }
public void DeferredRender( public void DeferredRender(
RenderTarget2D renderTarget,
PerspectiveCamera camera, PerspectiveCamera camera,
IEnumerable<(Model, Matrix)> modelTransforms, IEnumerable<(Model, Matrix)> modelTransforms,
AmbientLight ambientLight, AmbientLight ambientLight,
@ -200,8 +201,7 @@ namespace Kav
DirectionalLightRender(camera, modelTransforms, directionalLight); DirectionalLightRender(camera, modelTransforms, directionalLight);
GraphicsDevice.SetRenderTarget(null); GraphicsDevice.SetRenderTarget(renderTarget);
GraphicsDevice.Clear(Color.Black);
SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, ToneMapEffect); SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, ToneMapEffect);
SpriteBatch.Draw(ColorRenderTarget, Vector2.Zero, Color.White); SpriteBatch.Draw(ColorRenderTarget, Vector2.Zero, Color.White);
SpriteBatch.End(); SpriteBatch.End();