forge-3d-picking

Identify clicked objects in 3D SDL GPU scenes via color-ID and stencil-ID pipelines.

36|6|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-3d-picking-nebulavenus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-3d-picking
Source: https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-3d-picking
Command: npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-3d-picking-nebulavenus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify the object clicked in a 3D SDL GPU scene, enabling interactive selection and highlighting.

Core Features & Use Cases

  • Color-ID picking using an offscreen render target to map pixels to objects (supports up to 65,535 objects).
  • Stencil-ID picking with per-object references and an optional per-pass stencil workflow.
  • GPU-to-CPU readback via transfer buffers for selection results.
  • Selection outline highlighting using a two-pass stencil technique.
  • Use cases include in-game object selection, level editors, and debugging tools.

Quick Start

Trigger a click on the scene, perform a color-ID pass to map pixels to objects, and read back the selection to determine the clicked 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 implement 3D object picking in an SDL GPU application?

3D object picking in an SDL GPU app is implemented by rendering a color-ID pass to an offscreen target, mapping pixels to objects, and using GPU-to-CPU transfer buffers for readback to identify the clicked object.

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

Color-ID picking maps pixels to objects via an offscreen render target supporting up to 65,535 objects, while stencil-ID picking uses per-object stencil references and an optional per-pass stencil workflow for selection.

Can I render selection outlines using the stencil buffer in SDL?

Yes, selection outline highlighting can be rendered in SDL using a two-pass stencil technique that leverages per-object stencil references to visually distinguish the selected 3D object.

How do I read GPU pixel data back to the CPU for interactive selection?

GPU-to-CPU readback for interactive selection is performed using transfer buffers, allowing the application to retrieve the pixel-perfect selection results from the offscreen render target.

Does this color-ID picking approach support large 3D scenes with many objects?

Yes, the color-ID picking pipeline supports large scenes by encoding object identifiers in color values, accommodating up to 65,535 selectable objects within a single offscreen render target.