added blur

This commit is contained in:
2026-07-11 22:20:26 +03:00
parent 26823609e7
commit 1618a41318
5 changed files with 55 additions and 2 deletions
+5 -2
View File
@@ -66,7 +66,7 @@ namespace imgui_desktop::gui
ImGui::Begin("Controls", &m_opened,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
ImGui::PushItemWidth(160.f);
const auto draw_glow_controls = [](const char* label, GlowSettings& settings)
const auto draw_glow_controls = [](const char* label, GlowSettings& settings, const float max_radius = 30.f)
{
ImGui::PushID(label);
ImGui::TextUnformatted(label);
@@ -74,7 +74,7 @@ namespace imgui_desktop::gui
if (settings.enabled)
{
ImGui::ColorEdit4("Color", reinterpret_cast<float*>(&settings.color), ImGuiColorEditFlags_NoInputs);
ImGui::SliderFloat("Radius", &settings.radius, 1.f, 12.f);
ImGui::SliderFloat("Radius", &settings.radius, 1.f, max_radius);
ImGui::SliderFloat("Intensity", &settings.intensity, 0.f, 1.f);
}
ImGui::PopID();
@@ -86,6 +86,7 @@ namespace imgui_desktop::gui
ImGui::SliderFloat("Top Y", &m_entity_top_y, 20.f, m_entity_bottom_y - 20.f);
ImGui::SliderFloat("Bottom Y", &m_entity_bottom_y, m_entity_top_y + 20.f, vp->Size.y - 20.f);
ImGui::SliderFloat("Aspect", &m_entity_aspect, 1.f, 10.f);
draw_glow_controls("Canvas light", m_canvas_glow, 500.f);
}
if (ImGui::CollapsingHeader("Box", ImGuiTreeNodeFlags_DefaultOpen))
@@ -256,6 +257,7 @@ namespace imgui_desktop::gui
const auto cornered_box_glow = make_glow(m_cornered_box_glow);
const auto bar_glow = make_glow(m_bar_glow);
const auto label_glow = make_glow(m_label_glow);
const auto canvas_glow = make_glow(m_canvas_glow);
const Paint vertical_bar_color =
m_gradient_bars ? Paint{omath::hud::Gradient{bar_value_color, bar_value_color, red, red}}
: Paint{m_bar_color};
@@ -283,6 +285,7 @@ namespace imgui_desktop::gui
omath::hud::EntityOverlay({m_entity_x, m_entity_top_y}, {m_entity_x, m_entity_bottom_y}, m_entity_aspect,
std::make_shared<omath::hud::ImguiHudRenderer>())
.contents(
when(canvas_glow.has_value(), CanvasGlow{canvas_glow.value_or(Glow{m_canvas_glow.color})}),
// ── Boxes ────────────────────────────────────────────────────
when(m_show_box, Box{m_box_color, box_fill, m_box_outline, m_box_thickness, box_glow}),
when(m_show_cornered_box,
+1
View File
@@ -76,6 +76,7 @@ namespace imgui_desktop::gui
GlowSettings m_cornered_box_glow{{1.f, 0.f, 1.f, 0.8f}};
GlowSettings m_bar_glow{{1.f, 0.f, 0.f, 0.8f}};
GlowSettings m_label_glow;
GlowSettings m_canvas_glow{{1.f, 0.5f, 0.f, 0.8f}, 100.f};
// Skeleton
omath::Color m_skel_color = omath::Color::from_rgba(255, 255, 255, 200);