forge-instanced-rendering

Render repeated meshes with per-instance model matrices in a single draw call.

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-instanced-rendering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-instanced-rendering
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-instanced-rendering
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-instanced-rendering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instanced rendering allows drawing many copies of the same mesh with a single draw call by streaming per-instance transforms.

Core Features & Use Cases

  • Per-instance data: a 64-byte model matrix stored for each instance.
  • Dual-vertex buffer pipeline: one buffer for per-vertex data and one for per-instance transforms.
  • Seven vertex attributes including per-instance matrix columns and per-vertex attributes.
  • Vertex shader reconstruction of the model matrix from per-instance data and rendering via a shared VP matrix.
  • Use cases include forests, crowds, particle systems, buildings, or any scene with repeated geometry.

Quick Start

Create an array of InstanceData with a 64-byte model matrix for each instance, upload it as a per-instance buffer, and issue a single instanced draw.

Frequently Asked Questions about forge-instanced-rendering

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

FAQPage Schema
How does instanced rendering work for drawing repeated meshes in a single draw call?

Instanced rendering works by streaming per-instance transforms, allowing many copies of the same mesh to be drawn in a single draw call. A dual-vertex buffer pipeline supplies per-vertex data and a 64-byte model matrix per instance to reconstruct geometry via a shared VP matrix.

How do I set up per-instance data for instanced rendering of forests or crowds?

To set up per-instance data for instanced rendering, create an array of InstanceData containing a 64-byte model matrix for each instance. Upload this as a per-instance buffer alongside your per-vertex buffer, then issue a single instanced draw to render the scene.

What is the best way to render many identical meshes with individual transforms?

The best way to render many identical meshes with individual transforms is instanced rendering. It uses a dual-vertex buffer pipeline with seven vertex attributes, reconstructing the model matrix from per-instance data in the vertex shader to efficiently draw repeated geometry like particles or buildings.

Do I need a separate vertex buffer for per-instance transforms in instanced rendering?

Yes, instanced rendering requires a separate per-instance buffer for transforms. The dual-vertex buffer pipeline uses one buffer for per-vertex data and another to store the 64-byte model matrix per instance, enabling the shader to apply individual transforms to repeated geometry.

When should I use instanced rendering instead of individual draw calls?

You should use instanced rendering instead of individual draw calls when rendering scenes with repeated geometry requiring individual transforms, such as forests, crowds, particle systems, or buildings. It batches many copies of the same mesh into a single draw call for efficiency.

Can I reconstruct the model matrix from instance data in a vertex shader?

Yes, you can reconstruct the model matrix from instance data in a vertex shader. The shader uses seven vertex attributes representing per-instance matrix columns and per-vertex attributes, combining this per-instance data with a shared VP matrix to render the final geometry.