Pixel-perfect mouse picking with render attachment. Support instanced rendering and framebuffer recreation when resized.
- If you want mouse picking with stencil buffer (needs multiple draw calls), see the main branch.
- If you want to see the same work implemented in Vulkan, see here.
mouse-picking-with-instancing.mov
git clone https://github.com/stripe2933/mouse-picking.git
git checkout instancing
cd mouse-picking
mkdir build
# You may don't need to specify CMAKE_TOOLCHAIN_FILE if you already have all dependencies.
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Release
./build/mouse_picking
- fmt
- range-v3
- imgui
- imguizmo
- OGLWrapper - gl3w, glfw, glm, stb_image, eventpp