From a433c040d895cb7911e519f6605058cf6a8d17de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 30 May 2020 12:54:00 -0700 Subject: [PATCH] 42-bunnylod: Better slider control towards 0. --- examples/42-bunnylod/bunnylod.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/42-bunnylod/bunnylod.cpp b/examples/42-bunnylod/bunnylod.cpp index cc8e59160..a0ed04278 100644 --- a/examples/42-bunnylod/bunnylod.cpp +++ b/examples/42-bunnylod/bunnylod.cpp @@ -3,6 +3,7 @@ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ +#include #include "common.h" #include "bgfx_utils.h" #include "imgui/imgui.h" @@ -216,7 +217,7 @@ public: } void updateIndexBuffer() { - int verts = m_LOD * m_totalVertices; + int verts = bx::easeInQuad(m_LOD) * m_totalVertices; if (verts <= 0) return; @@ -297,6 +298,7 @@ public: ImGui::Text("Vertices: %d", m_numVertices); ImGui::Text("Triangles: %d", m_numTriangles); + ImGui::SliderFloat("LOD Level", &m_LOD, 0.0f, 1.0f); ImGui::End();