From b01a32194e8d81a03572e0cd86a23add6e039d72 Mon Sep 17 00:00:00 2001 From: Slendi Date: Wed, 17 Dec 2025 21:31:11 +0200 Subject: [PATCH] boop Signed-off-by: Slendi --- shaders/gradient.comp | 23 ----------------------- shaders/gradient_fullscreen.frag | 21 --------------------- shaders/gradient_fullscreen.vert | 13 ------------- src/Application.cpp | 22 ++++++++++++++++++++++ 4 files changed, 22 insertions(+), 57 deletions(-) delete mode 100644 shaders/gradient.comp delete mode 100644 shaders/gradient_fullscreen.frag delete mode 100644 shaders/gradient_fullscreen.vert diff --git a/shaders/gradient.comp b/shaders/gradient.comp deleted file mode 100644 index 9477b61..0000000 --- a/shaders/gradient.comp +++ /dev/null @@ -1,23 +0,0 @@ -#version 460 - -layout (local_size_x = 16, local_size_y = 16) in; -layout(rgba16f, set = 0, binding = 0) uniform image2D image; - -void main() { - ivec2 texelCoord = ivec2(gl_GlobalInvocationID.xy); - ivec2 size = imageSize(image); - - if (texelCoord.x >= size.x || texelCoord.y >= size.y) - return; - - vec2 uv = (vec2(texelCoord) + 0.5) / vec2(size); - - float v = sin(uv.x * 10.0) + cos(uv.y * 10.0); - - float r = 0.5 + 0.5 * cos(6.2831 * (uv.x + v)); - float g = 0.5 + 0.5 * cos(6.2831 * (uv.y + v + 0.33)); - float b = 0.5 + 0.5 * cos(6.2831 * (uv.x - uv.y + 0.66)); - - vec4 color = vec4(r, g, b, 1.0); - imageStore(image, texelCoord, color); -} diff --git a/shaders/gradient_fullscreen.frag b/shaders/gradient_fullscreen.frag deleted file mode 100644 index f2e3a82..0000000 --- a/shaders/gradient_fullscreen.frag +++ /dev/null @@ -1,21 +0,0 @@ -#version 450 - -layout(location = 0) out vec4 out_color; - -layout(push_constant) uniform PushConstants { - vec2 resolution; -} pc; - -void main() -{ - vec2 uv = (gl_FragCoord.xy + vec2(0.5)) / pc.resolution; - - float v = sin(uv.x * 10.0) + cos(uv.y * 10.0); - - float r = 0.5 + 0.5 * cos(6.2831 * (uv.x + v)); - float g = 0.5 + 0.5 * cos(6.2831 * (uv.y + v + 0.33)); - float b = 0.5 + 0.5 * cos(6.2831 * (uv.x - uv.y + 0.66)); - - out_color = vec4(r, g, b, 1.0); -} - diff --git a/shaders/gradient_fullscreen.vert b/shaders/gradient_fullscreen.vert deleted file mode 100644 index b828af0..0000000 --- a/shaders/gradient_fullscreen.vert +++ /dev/null @@ -1,13 +0,0 @@ -#version 450 - -void main() -{ - vec2 positions[3] = vec2[]( - vec2(-1.0, -1.0), - vec2( 3.0, -1.0), - vec2(-1.0, 3.0) - ); - - gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); -} - diff --git a/src/Application.cpp b/src/Application.cpp index 87c7999..d254209 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -306,6 +306,28 @@ auto Application::run() -> void ImGui::Text("%s", std::format("FPS: {:.2f}", fps).c_str()); } ImGui::PopStyleColor(); + + if (ImGui::Begin("Fun menu")) { + defer(ImGui::End()); + + static std::array const aa_items { + "None", + "MSAA 2X", + "MSAA 4X", + "MSAA 8X", + }; + int selected_item { + static_cast(m_renderer->antialiasing()), + }; + int prev_selected_item { selected_item }; + ImGui::Combo("Antialiasing", &selected_item, aa_items.data(), + aa_items.size()); + if (prev_selected_item != selected_item) { + m_renderer->set_antialiasing( + static_cast( + selected_item)); + } + } } ImGui::Render();