forge-3d-picking

Identify clicked 3D objects in SDL GPU projects using color-ID and stencil-ID picking.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-3d-picking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-3d-picking
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-3d-picking
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-3d-picking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify which 3D object the user clicked in an SDL GPU project.

Core Features & Use Cases

  • Color-ID picking using offscreen render targets to map screen pixels to object indices.
  • Stencil-ID picking using per-object reference values for fast, GPU-driven selection.
  • GPU-to-CPU data transfer with transfer buffers and optional readback for hover or selection logic.
  • Selection outline highlighting to visually distinguish the picked object.
  • Reuse with existing render pipelines by combining color-ID and stencil-ID approaches as needed.

Quick Start

Integrate the color-ID and stencil-ID picking pipelines into your SDL GPU project and trigger a click to select an object.

Frequently Asked Questions about forge-3d-picking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify which 3D object a user clicked in an SDL GPU project?

3D object picking in an SDL GPU project is achieved by using color-ID and stencil-ID techniques to map screen pixels to object indices, enabling pixel-precise selection during interactive rendering.

What is the difference between color-ID and stencil-ID picking?

Color-ID picking uses offscreen render targets to map screen pixels to object indices, while stencil-ID picking uses per-object reference values for fast, GPU-driven selection and outline highlighting.

Can I read GPU picking results back to the CPU for hover logic?

Yes, GPU-to-CPU readback is supported using transfer buffers, allowing you to retrieve picked object data from the GPU to drive CPU-side hover or selection logic in your graphics application.

Does this 3D picking approach support visual selection outlines?

Yes, a stencil-based selection outline workflow is included to visually distinguish the picked 3D object, allowing you to highlight selected geometry directly within your existing SDL GPU render pipeline.

Can I integrate 3D object picking into an existing SDL GPU render pipeline?

Yes, you can combine the color-ID and stencil-ID picking pipelines with your existing SDL GPU render setup as needed, reusing current rendering workflows while adding pixel-precise object selection.

When should I use offscreen render targets for 3D object selection?

Offscreen render targets are used for color-ID picking when you need to accurately map screen pixels to specific 3D object indices, which is essential for pixel-precise selection in interactive graphics apps.