From d3382e22ff9377a968502d52187bf22733c9ed34 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Sat, 16 Mar 2024 11:51:32 -0400 Subject: [PATCH] Can no longer select occluded gizmos --- Nuake/src/Resource/StaticResources.cpp | 18 +++++++++++------- Resources/Shaders/gizmo.shader | 5 ++++- Resources/Shaders/outline.shader | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Nuake/src/Resource/StaticResources.cpp b/Nuake/src/Resource/StaticResources.cpp index 65d842c2..7c1751ff 100644 --- a/Nuake/src/Resource/StaticResources.cpp +++ b/Nuake/src/Resource/StaticResources.cpp @@ -235272,13 +235272,17 @@ const std::string Resources_Shaders_gizmo_shader_path = R"(Resources/Shaders/giz 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x2a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, 0x31, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0d, 0x0a, - 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x49, 0x44, 0x20, 0x3d, 0x20, 0x75, 0x5f, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x49, 0x44, 0x3b, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, - 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0d, 0x0a, 0x7d + 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x75, 0x5f, 0x4f, + 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x2e, + 0x35, 0x66, 0x29, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0d, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x49, 0x44, 0x20, 0x3d, 0x20, 0x75, 0x5f, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x49, 0x44, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x72, + 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x3b, 0x0d, 0x0a, 0x7d }; - unsigned int Resources_Shaders_gizmo_shader_len = 994; + unsigned int Resources_Shaders_gizmo_shader_len = 1039; // Data for file: Resources_Shaders_line_shader_path const std::string Resources_Shaders_line_shader_path = R"(Resources/Shaders/line.shader)"; @@ -235440,7 +235444,7 @@ const std::string Resources_Shaders_outline_shader_path = R"(Resources/Shaders/o 0x64, 0x0d, 0x0a, 0x09, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x20, 0x3d, 0x20, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x73, 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, - 0x2e, 0x37, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x63, 0x6f, 0x6c, 0x20, + 0x2e, 0x39, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x63, 0x6f, 0x6c, 0x20, 0x21, 0x3d, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x29, 0x20, 0x2a, 0x20, 0x68, 0x61, 0x73, 0x48, 0x69, 0x74, 0x20, 0x2a, 0x20, 0x31, 0x30, 0x2e, 0x30, 0x66, 0x29, 0x3b, 0x0d, 0x0a, 0x09, 0x09, 0x66, 0x72, 0x61, diff --git a/Resources/Shaders/gizmo.shader b/Resources/Shaders/gizmo.shader index d7239976..bd418f96 100644 --- a/Resources/Shaders/gizmo.shader +++ b/Resources/Shaders/gizmo.shader @@ -42,7 +42,10 @@ void main() vec4 px_color = texture(gizmo_texture, a_UV).rgba; color = px_color * vec4(1, 1, 1, u_Opacity); - gEntityID = u_EntityID; + if(u_Opacity >= 0.5f) + { + gEntityID = u_EntityID; + } FragColor = color; } \ No newline at end of file diff --git a/Resources/Shaders/outline.shader b/Resources/Shaders/outline.shader index 8bddf576..0219f089 100644 --- a/Resources/Shaders/outline.shader +++ b/Resources/Shaders/outline.shader @@ -52,7 +52,7 @@ void main() } // Mix outline with background - float alpha = smoothstep(0.5, 0.7, int(col != target) * hasHit * 10.0f); + float alpha = smoothstep(0.5, 0.9, int(col != target) * hasHit * 10.0f); fragColor = mix(fragColor, u_OutlineColor, alpha); }