Gizmo mouse picking now works
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Nuake
|
||||
const Vector2 defaultResolution = Vector2(1, 1);
|
||||
m_Framebuffer = CreateRef<FrameBuffer>(true, defaultResolution);
|
||||
m_Framebuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB));
|
||||
m_Framebuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RED_INTEGER, GL_R32I, GL_INT), GL_COLOR_ATTACHMENT3); // Entity ID
|
||||
m_Framebuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RED_INTEGER, GL_R32I, GL_INT), GL_COLOR_ATTACHMENT1); // Entity ID
|
||||
|
||||
InitImgui();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user