pixijs-scene-mesh
pixijs/pixijs-skills
Render custom 2D geometry and deformable shapes in PixiJS v8 with Mesh, MeshPlane, MeshRope, and PerspectiveMesh.
What is pixijs-scene-mesh?
This skill covers PixiJS v8 mesh rendering for arbitrary geometry, subdivided planes, path-following ropes, and perspective-projected quads. Use it when you need vertex-level control, deformation effects, or shapes beyond simple sprites.
- Render custom geometry with MeshGeometry (positions, uvs, indices, topology)
- Deform textured rectangles with MeshPlane using subdivided vertices
- Create rope or trail effects following polyline paths with MeshRope
- Apply perspective corner correction to 2D planes with PerspectiveMesh
- Animate vertices per-frame with MeshSimple
- Hit-test meshes with topology-aware containsPoint()
How to install pixijs-scene-mesh
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-mesh- PixiJS v8 installed
- Familiarity with pixijs-scene-core-concepts
- A texture asset loaded via Assets.load()
How to use pixijs-scene-mesh
- 1.Load a texture using Assets.load()
- 2.Choose the appropriate mesh variant (Mesh, MeshSimple, MeshPlane, MeshRope, or PerspectiveMesh)
- 3.For base Mesh, create a MeshGeometry with positions, uvs, indices, and topology
- 4.For subclasses, pass texture and shape-specific options (e.g., verticesX/verticesY for MeshPlane, points for MeshRope)
- 5.Create the mesh instance with the options object
- 6.Add the mesh to app.stage or a Container
- 7.Update vertex data each frame if using MeshSimple or custom animation
Use cases
- Deforming a textured rectangle for wave or ripple effects using MeshPlane
- Drawing a rope or trail that follows a series of points with MeshRope
- Creating a tilted 2D card or floor tile with perspective using PerspectiveMesh
- Rendering a custom polygon or irregular shape with hand-built MeshGeometry
- Animating vertex positions each frame for cloth or fluid simulation with MeshSimple
- Game developers building 2D graphics with deformation
- Visual effects engineers creating rope, trail, or distortion effects
- UI developers needing perspective-corrected 2D planes
- Graphics programmers working with custom shaders and geometry
pixijs-scene-mesh FAQ
Base Mesh requires you to build MeshGeometry yourself for full control. Subclasses (MeshSimple, MeshPlane, MeshRope, PerspectiveMesh) build geometry internally and are optimized for common shapes. Pick the subclass that matches your use case.
No. Mesh sets allowChildren = false. Group multiple meshes inside a Container instead.
Use MeshSimple for simple shapes, or access the MeshGeometry's positions buffer directly and call geometry.invalidate() after changes.
v8 renamed SimpleMesh → MeshSimple, SimplePlane → MeshPlane, and SimpleRope → MeshRope. All now use options-object constructors instead of positional arguments.
Yes, if using MeshGeometry with no custom shader, no depth/culling state, and ≤100 vertices with batchMode='auto'. Custom shaders always render independently.
Full instructions (SKILL.md)
Source of truth, from pixijs/pixijs-skills.
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
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 |
MeshSimple | Quick textured shapes with per-frame vertex animation | Thin wrapper; auto-updates the vertex buffer | references/mesh-simple.md |
MeshPlane | Subdivided textured rectangle for distortion effects | Fixed topology; verticesX/verticesY control density | references/mesh-plane.md |
MeshRope | Texture following a polyline path | Bent at each point; needs many points for smooth curves | references/mesh-rope.md |
PerspectiveMesh | 2D plane with perspective corners | Not true 3D; UV-level perspective correction only | references/mesh-perspective.md |
When to use what
- "I need a textured quad" →
Sprite(seepixijs-scene-sprite), not a mesh. Meshes are for cases Sprite can't express. - "I need to deform a textured rectangle" →
MeshPlane. SetverticesX/verticesYfor the desired smoothness. - "I need a rope or trail that follows points" →
MeshRope. Control thickness withwidth; usetextureScale: 0to stretch or> 0to 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
Meshwith a hand-builtMeshGeometry. Seepixijs-custom-renderingfor shader authoring. - "I need true 3D rendering" → Use a dedicated 3D library.
PerspectiveMeshsimulates 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 anyMeshGeometry, including custom layouts.new Mesh({ geometry, state })— pass aStateobject to control blend, depth, and culling. Batching is disabled automatically if depth or culling flags are set. Defaults toState.for2d()when omitted.
Common Mistakes
[HIGH] Using old SimpleMesh / SimplePlane / SimpleRope names
Wrong:
import { SimpleRope } from "pixi.js";
const rope = new SimpleRope(texture, points);
Correct:
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:
const geom = new MeshGeometry(vertices, uvs, indices);
Correct:
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:
mesh.addChild(otherMesh);
Correct:
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
Related skills
More from pixijs/pixijs-skills and the wider catalog.

pixijs-scene-particle-container
Render thousands of lightweight sprites efficiently in PixiJS v8 using ParticleContainer.

pixijs-scene-sprite
Draw and animate images in PixiJS v8 with Sprite, AnimatedSprite, NineSliceSprite, and TilingSprite.

pixijs-scene-text
Render styled text in PixiJS v8 with Text, BitmapText, HTMLText, and split variants for animation.

pixijs-ticker
Control PixiJS v8 render loop with frame-rate-independent animation and priority-based callbacks.

mysql
Plan and review MySQL/InnoDB schema, indexing, query tuning, transactions, and operations.

neki
Overview and information about Neki, the sharded Postgres product by PlanetScale. Load when working with Neki-related tasks and the need to scale or shard postgres. Load when facing Postgres scaling or sharding issues.