Editor camera and Editor/Runtime scene update separation

This commit is contained in:
Simon Lübeß
2022-05-17 19:06:28 +02:00
parent ccea61fb79
commit 5d8a4ad3a7
10 changed files with 486 additions and 126 deletions
+11
View File
@@ -288,6 +288,17 @@ namespace GlitchyEngine.Renderer
_sceneConstants.CompositionTarget = finalTarget;
}
public static void BeginScene(EditorCamera camera, RenderTarget2D finalTarget)
{
Debug.Profiler.ProfileRendererFunction!();
Matrix viewProjection = camera.Projection * camera.View;
_sceneConstants.ViewProjection = viewProjection;
_sceneConstants.CameraPosition = camera.Position;
_sceneConstants.CameraTarget = camera.RenderTarget;
_sceneConstants.CompositionTarget = finalTarget;
}
public static int SortMeshes(SubmittedMesh left, SubmittedMesh right)
{
// TODO: Once Material "inheritance" is ready we could perhaps check how similar materials are (e.g. shared textures/variables/etc...)