Render EntityIDs (breaks post processing)

This commit is contained in:
Simon Lübeß
2022-05-28 15:42:48 +02:00
parent 164d420a25
commit d212576719
17 changed files with 242 additions and 191 deletions
@@ -93,7 +93,8 @@ namespace GlitchyEditor.EditWindows
if(_renderTarget != null)
{
ImGui.Image(_renderTarget.GetViewBinding(0), viewportSize);
//ImGui.Image(_renderTarget.GetViewBinding(0), viewportSize);
ImGui.Image(_editor.CurrentCamera.RenderTarget.GetViewBinding(0), viewportSize);
}
Vector2 relativeMouse = (Vector2)ImGui.GetMousePos() - (Vector2)ImGui.GetItemRectMin();
@@ -105,20 +106,18 @@ namespace GlitchyEditor.EditWindows
relativeMouse.X < viewportSize.x && relativeMouse.Y < viewportSize.y &&
relativeMouse.X < x && relativeMouse.Y < y)
{
uint32 id = 0;
Renderer.[Friend]_gBuffer.Target.GetData<uint32>(&id, 5, (.)relativeMouse.X, (.)relativeMouse.Y, 1, 1);
id--;
uint32 id = uint32.MaxValue;
_editor.CurrentCamera.RenderTarget.GetData<uint32>(&id, 1, (.)relativeMouse.X, (.)relativeMouse.Y, 1, 1);
//_renderTarget.GetData<uint32>(&pixel, 0, );
Log.EngineLogger.Info($"{relativeMouse} || ID = {id}");
/*if (id != uint32.MaxValue)
if (id != uint32.MaxValue)
{
_editor.CurrentScene.[Friend]_ecsWorld.GetCurrentVersion()
}*/
//_editor.CurrentScene.[Friend]_ecsWorld.GetCurrentVersion()
}
//_editor.EntityHierarchyWindow.SelectEntityWithId(id, true);
}