Render 2D with depth, reverse depth of camera projection

dirty fix in Renderer...
This commit is contained in:
Simon Lübeß
2024-02-16 17:31:32 +01:00
parent 0321bd91c4
commit 59aaec572b
5 changed files with 24 additions and 10 deletions
+3
View File
@@ -392,6 +392,9 @@ namespace GlitchyEngine.Renderer
_lights.Clear();
// TODO: I don't understand why we need to clear depth here. It should happen in SceneRenderer, but doesn't work for some reason...
RenderCommand.Clear(_sceneConstants.CompositionTarget, .Depth);
// Copy EntityIDs to compositionTarget
_gBuffer.Target.CopyTo(_sceneConstants.CompositionTarget, 1, int2.Zero, int2((int32)_sceneConstants.CameraTarget.Width, (int32)_sceneConstants.CameraTarget.Height), int2.Zero, 6);
+4
View File
@@ -758,10 +758,14 @@ namespace GlitchyEngine.Renderer
return;
SortInstances();
RenderCommand.SetDepthStencilState(Renderer.[Friend]_meshDepthStencilState);
DrawDeferredQuads();
DrawDeferredCircles();
DrawDeferredLines();
RenderCommand.SetDepthStencilState(Renderer.[Friend]_fullscreenDepthState);
}
private static void DrawDeferredQuads()