Pixel-perfect mouse picking with OpenGL stencil buffer. If you want another mouse picking example with custom FBO + instancing, see instancing branch. It unlimits the available object count in this branch (255 at max).
- If you want another mouse picking example with custom FBO + instancing, see instancing branch. It unlimits the available object count in this branch (255 at max).
- If you want to see the same work implemented in Vulkan, see here.
running-video.mp4
git clone https://github.com/stripe2933/mouse-picking.git
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