diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index dedebd00..297f24f4 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -278,7 +278,7 @@ namespace Nuake { auto gizmoBuffer = Engine::GetCurrentWindow()->GetFrameBuffer(); gizmoBuffer->Bind(); bool foundSomethingToSelect = false; - if (const int result = gizmoBuffer->ReadPixel(3, pixelPos); result > 0) + if (const int result = gizmoBuffer->ReadPixel(1, pixelPos); result > 0) { auto ent = Entity{ (entt::entity)(result - 1), Engine::GetCurrentScene().get() }; if (ent.IsValid()) diff --git a/Nuake/src/Resource/StaticResources.cpp b/Nuake/src/Resource/StaticResources.cpp index 5c35e0a1..991b291b 100644 --- a/Nuake/src/Resource/StaticResources.cpp +++ b/Nuake/src/Resource/StaticResources.cpp @@ -235175,7 +235175,7 @@ const std::string Resources_Shaders_gizmo_shader_path = R"(Resources/Shaders/giz 0x20, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0d, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x3d, 0x20, 0x33, 0x29, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x69, + 0x6e, 0x20, 0x3d, 0x20, 0x31, 0x29, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x67, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x44, 0x3b, 0x0d, 0x0a, 0x0d, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x55, 0x56, 0x3b, 0x0d, 0x0a, 0x69, 0x6e, 0x20, 0x6d, diff --git a/Nuake/src/Window.cpp b/Nuake/src/Window.cpp index ff97117c..902e6e6e 100644 --- a/Nuake/src/Window.cpp +++ b/Nuake/src/Window.cpp @@ -102,7 +102,7 @@ namespace Nuake const Vector2 defaultResolution = Vector2(1, 1); m_Framebuffer = CreateRef(true, defaultResolution); m_Framebuffer->SetTexture(CreateRef(defaultResolution, GL_RGB)); - m_Framebuffer->SetTexture(CreateRef(defaultResolution, GL_RED_INTEGER, GL_R32I, GL_INT), GL_COLOR_ATTACHMENT3); // Entity ID + m_Framebuffer->SetTexture(CreateRef(defaultResolution, GL_RED_INTEGER, GL_R32I, GL_INT), GL_COLOR_ATTACHMENT1); // Entity ID InitImgui(); diff --git a/Resources/Shaders/gizmo.shader b/Resources/Shaders/gizmo.shader index ffc694fe..d7239976 100644 --- a/Resources/Shaders/gizmo.shader +++ b/Resources/Shaders/gizmo.shader @@ -24,7 +24,7 @@ void main() #version 440 core layout(location = 0) out vec4 FragColor; -layout(location = 3) out int gEntityID; +layout(location = 1) out int gEntityID; in vec2 a_UV; in mat4 o_Projection;