lbc3402785 / mouse-picking

Pixel-perfect mouse picking with OpenGL stencil buffer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mouse-picking

License: MIT

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

Build

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

Dependencies

  • fmt
  • range-v3
  • imgui
  • imguizmo
  • OGLWrapper - gl3w, glfw, glm, stb_image, eventpp

About

Pixel-perfect mouse picking with OpenGL stencil buffer.

License:MIT License


Languages

Language:C++ 86.9%Language:GLSL 8.6%Language:CMake 4.4%