Skip to main content
skill CX Codex

pixijs-scene-mesh — Claude Code skill: what it does, how to install

Guides custom 2D geometry rendering in PixiJS v8 via Mesh, MeshPlane, MeshRope, and PerspectiveMesh. Useful for per-frame vertex animations, rope trails, and perspective distortion.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code
Open on GitHub

What pixijs-scene-mesh does

This skill guides the AI assistant on rendering custom geometry in PixiJS v8. It covers the base Mesh class with MeshGeometry alongside four specialized subclasses: MeshSimple for per-frame coordinate changes, MeshPlane for grid deformations, MeshRope for textures following a polyline, and PerspectiveMesh for 2.5D perspective planes.

All constructors in v8 take a single options object instead of positional parameters. Meshes act strictly as leaf nodes with allowChildren = false. Direct child addition triggers a deprecation warning, meaning grouping requires a standard Container.

Batching works only when specific constraints are met: standard MeshGeometry, no custom shaders or culling states, and 100 vertices or fewer under batchMode = 'auto'.

What it helps with

  • build custom geometry buffers using MeshGeometry
  • deform a textured plane using MeshPlane
  • follow a polyline path with textures using MeshRope
  • project 2.5D perspective planes with PerspectiveMesh
  • animate vertex buffers every frame via MeshSimple

Example prompts for the agent

  • Create a MeshRope from an array of points with a stretching texture
  • Set up PerspectiveMesh to tilt a 2D card in PixiJS v8
  • Build a MeshGeometry using indices and triangle-strip topology

How to install pixijs-scene-mesh

1Skills CLI (Vercel)

npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code

2Manually: put the files in place

~/.claude/skills/pixijs-scene-mesh/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pixijs-scene-mesh/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about pixijs-scene-mesh

How do I install pixijs-scene-mesh in Claude Code?

Run npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code.

What does pixijs-scene-mesh do?

The skill guides custom geometry rendering in PixiJS v8 across base Mesh and subclasses like MeshPlane or MeshRope. It also prevents common migration mistakes from older PixiJS releases.

Can a PixiJS mesh have child display objects?

No, meshes in PixiJS v8 are leaf nodes with allowChildren = false. Wrap multiple meshes inside a standard Container to group them together.

Source text

SKILL.md · MIT
---
name: pixijs-scene-mesh
description: "Use this skill when rendering custom geometry in PixiJS v8. Covers Mesh with MeshGeometry (positions, uvs, indices, topology), MeshSimple for per-frame vertex animation, MeshPlane for subdivided deformation, MeshRope for path-following textures, PerspectiveMesh for 2.5D corners. Triggers on: Mesh, MeshGeometry, MeshSimple, MeshPlane, MeshRope, PerspectiveMesh, positions, uvs, indices, topology, setCorners, constructor options, MeshOptions, MeshPlaneOptions, MeshRopeOptions, SimpleMeshOptions, PerspectivePlaneOptions."
license: MIT
---

Meshes render arbitrary 2D (or perspective-projected) geometry with a texture or custom shader. PixiJS ships the base `Mesh` class plus four specialized subclasses for common shapes: `MeshSimple`, `MeshPlane`, `MeshRope`, and `PerspectiveMesh`. Pick the subclass that matches your shape; drop to the base `Mesh` when you need full vertex-level control or a custom shader.

Assumes familiarity with `pixijs-scene-core-concepts`. Meshes are leaf nodes; they cannot have children. Wrap multiple meshes in a `Container` to group them.

## Quick Start

```ts
const texture = await Assets.load("pattern.png");

const geometry = new MeshGeometry({
  positions: new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]),
  uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  indices: new Uint32Array([0, 1, 2, 0, 2, 3]),
  topology: "triangle-list",
});

const mesh = new Mesh({
  geometry,
  texture,
  roundPixels: false,
});
app.stage.addChild(mesh);
```

Every `Mesh` subclass takes a single options object. The base `Mesh` requires a `geometry`; subclasses (`MeshSimple`, `MeshPlane`, `MeshRope`, `PerspectiveMesh`) build the geometry internally and require a `texture` instead. See each variant's reference for the full field list.

## Variants

| Variant           | Use when                                              | Trade-offs                                              | Reference                                                        |
| ----------------- | ----------------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- |
| `Mesh`            | Full control, custom geometry, custom shaders         | You build the `MeshGeometry` yourself                   | [references/mesh.md](references/mesh.md)                         |
| `MeshSimple`      | Quick textured shapes with per-frame vertex animation | Thin wrapper; auto-updates the vertex buffer            | [references/mesh-simple.md](references/mesh-simple.md)           |
| `MeshPlane`       | Subdivided textured rectangle for distortion effects  | Fixed topology; `verticesX`/`verticesY` control density | [references/mesh-plane.md](references/mesh-plane.md)             |
| `MeshRope`        | Texture following a polyline path                     | Bent at each point; needs many points for smooth curves | [references/mesh-rope.md](references/mesh-rope.md)               |
| `PerspectiveMesh` | 2D plane with perspective corners                     | Not true 3D; UV-level perspective correction only       | [references/mesh-perspective.md](references/mesh-perspective.md) |

## When to use what

- **"I need a textured quad"** → `Sprite` (see `pixijs-scene-sprite`), not a mesh. Meshes are for cases Sprite can't express.
- **"I need to deform a textured rectangle"** → `MeshPlane`. Set `verticesX`/`verticesY` for the desired smoothness.
- **"I need a rope or trail that follows points"** → `MeshRope`. Control thickness with `width`; use `textureScale: 0` to stretch or `> 0` to repeat.
- **"I need a tilted 2D card or floor"** → `PerspectiveMesh`. Pass four corner positions; not real 3D but good enough for 2.5D effects.
- **"I need per-frame animated vertices with a simple shape"** → `MeshSimple`. It handles the buffer-update dance for you.
- **"I need a custom shader or unusual geometry"** → Base `Mesh` with a hand-built `MeshGeometry`. See `pixijs-custom-rendering` for shader authoring.
- **"I need true 3D rendering"** → Use a dedicated 3D library. `PerspectiveMesh` simulates perspective at the UV level but has no depth buffer.

## Quick concepts

### MeshGeometry owns the vertex data

`MeshGeometry` holds the `positions`, `uvs`, `indices`, and `topology`. You can share one geometry across multiple `Mesh` instances; positions are reference-counted.

### Batching

A mesh batches (combines with other draw calls) only if it uses `MeshGeometry`, has no custom shader, no depth or culling state, and the `'auto'` rule (`batchMode = 'auto'` and ≤100 vertices). Custom shaders always render independently.

### Topology is on the geometry, not the mesh

`new MeshGeometry({ topology: 'triangle-strip' })`; topology is a geometry property. The default is `'triangle-list'`; set it explicitly if your data is organized differently.

### Extra knobs

- `new MeshGeometry({ shrinkBuffersToFit: true })` — trims GPU buffer storage to the actual vertex count on creation. Use it when feeding large, one-shot geometries.
- `Mesh.containsPoint(point)` — topology-aware hit test that walks the triangles. Works with any `MeshGeometry`, including custom layouts.
- `new Mesh({ geometry, state })` — pass a `State` object to control blend, depth, and culling. Batching is disabled automatically if depth or culling flags are set. Defaults to `State.for2d()` when omitted.

## Common Mistakes

### [HIGH] Using old `SimpleMesh` / `SimplePlane` / `SimpleRope` names

Wrong:

```ts
import { SimpleRope } from "pixi.js";
const rope = new SimpleRope(texture, points);
```

Correct:

```ts
import { MeshRope } from "pixi.js";
const rope = new MeshRope({ texture, points });
```

Renamed in v8: `SimpleMesh` → `MeshSimple`, `SimplePlane` → `MeshPlane`, `SimpleRope` → `MeshRope`. All switched to options-object constructors.


### [HIGH] Positional constructor args for `MeshGeometry`

Wrong:

```ts
const geom = new MeshGeometry(vertices, uvs, indices);
```

Correct:

```ts
const geom = new MeshGeometry({
  positions: vertices,
  uvs,
  indices,
  topology: "triangle-list",
});
```

v8 uses an options object. Note the property is `positions`, not `vertices`; the `vertices` name is only used by `MeshSimple`.


### [MEDIUM] Adding children to a mesh

Wrong:

```ts
mesh.addChild(otherMesh);
```

Correct:

```ts
const group = new Container();
group.addChild(mesh, otherMesh);
```

`Mesh` sets `allowChildren = false`. Adding children logs a deprecation warning. Group meshes inside a plain `Container`.


## API Reference

- [Mesh](https://pixijs.download/release/docs/scene.Mesh.html.md)
- [MeshGeometry](https://pixijs.download/release/docs/scene.MeshGeometry.html.md)
- [MeshSimple](https://pixijs.download/release/docs/scene.MeshSimple.html.md)
- [MeshPlane](https://pixijs.download/release/docs/scene.MeshPlane.html.md)
- [MeshRope](https://pixijs.download/release/docs/scene.MeshRope.html.md)
- [PerspectiveMesh](https://pixijs.download/release/docs/scene.PerspectiveMesh.html.md)

© pixijs · MIT · pixijs/pixijs-skills

Similar skills

Everything for Frontend and UI →

From the same set26

pixijs-ticker A skill for per-frame logic in PixiJS v8: ticker callbacks, time units, priority ordering and frame rate capping. CX Codex +1 5,800installs pixijs-scene-text Teaches coding agents to render text in PixiJS v8 properly. Helps pick between bitmap, HTML, and canvas rendering without stalling frame updates. CX Codex +1 5,800installs pixijs-scene-core-concepts Explains how the PixiJS v8 scene graph fits together: containers, leaves, transforms and render order. Useful when your agent writes PixiJS code. CX Codex +1 5,900installs pixijs-math A skill covering coordinates, matrices, shapes and hit testing in PixiJS v8. Useful when a point has to move between coordinate spaces or a container needs a custom hit area. CX Codex +1 5,900installs pixijs-scene-dom-container Teaches the agent how to overlay HTML elements on a PixiJS v8 canvas with DOMContainer and DOMPipe. Useful for native inputs, iframes or video that must follow a display object. CX Codex +1 5,700installs pixijs-blend-modes A skill that tells your agent how to composite PixiJS v8 display objects with blendMode: standard modes, advanced ones, and batch-friendly ordering. CX Codex +1 5,700installs pixijs-color PixiJS v8 skill for the Color class. It guides color conversions, tint calculations, and buffer reuse to prevent GC spikes in animation loops. CX Codex +1 5,700installs pixijs-create The skill walks your agent through scaffolding a PixiJS v8 project or adding the library to an existing one: templates, package managers, TypeScript setup. CX Codex +1 5,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor