pixijs-custom-rendering
Master shader development for PixiJS v8 by writing custom GLSL and WGSL code with properly typed uniforms. This skill covers the shader pipeline, uniform management, and integration with PixiJS's rendering system to unlock advanced visual effects and performance optimization.
pixijs-custom-rendering teaches you to write GLSL and WGSL shaders for PixiJS v8 using the Shader.from API. You define vertex and fragment shaders with typed UniformGroup objects, then bind them to sprites, meshes, or filters. The skill covers shader syntax, uniform declarations (f32, vec4, mat4), and integration with PixiJS's GlProgram and GpuProgram backends for both WebGL2 and WebGPU rendering paths.
AI-generated summary based on this skill's SKILL.md
Install
pixijs/pixijs-skills/pixijs-custom-rendering
git clone https://github.com/pixijs/pixijs-skills
cp -r pixijs-skills/skills/pixijs-custom-rendering ~/.claude/skills/pixijs-custom-renderingFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I write GLSL shader pixi custom rendering code for v8?
pixijs-custom-rendering teaches you to write GLSL and WGSL shaders for PixiJS v8 using the Shader.from API. You define vertex and fragment shaders with typed UniformGroup objects, then bind them to sprites, meshes, or filters. The skill covers shader syntax, uniform declarations (f32, vec4, mat4), and integration with PixiJS's GlProgram and GpuProgram backends for both WebGL2 and WebGPU rendering paths.
What is the pixijs-custom-rendering approach to Filter.from?
pixijs-custom-rendering explains Filter.from as the primary method for creating custom filters with fragment shaders in PixiJS v8. You provide a fragment shader string and optional uniforms; the filter automatically handles the rendering pipeline, texture binding, and blend modes. This pattern simplifies custom visual effects without manually managing the full shader compilation and resource lifecycle.
How do I manage UBO (Uniform Buffer Objects) in pixijs-custom-rendering?
pixijs-custom-rendering covers UBO management for both WebGL2 and WebGPU. You create UniformGroup instances with typed uniform data, then pass them to Shader.from or Filter.from. The skill teaches how to structure uniforms (f32, vec4, matrices), update them at runtime, and let PixiJS handle the underlying buffer allocation and synchronization across rendering backends.
Can pixijs-custom-rendering help migrate shaders from v7 to v8?
Yes. pixijs-custom-rendering addresses shader migration from PixiJS v7 to v8, covering API changes in Shader.from, UniformGroup typing, and the unified GLSL/WGSL pipeline. The skill explains how v8's typed uniforms replace v7's looser patterns and how to adapt custom batchers and resource management to the new extension architecture.
How does pixijs-custom-rendering handle shader resources and textures?
pixijs-custom-rendering teaches resource binding via the resources flat map in Shader.from and Filter.from. You declare texture uniforms (samplers) in your shader, then provide them as resources. The skill covers texture-as-resource patterns, uBackTexture for filter input, and how PixiJS automatically manages texture slot allocation for both WebGL2 and WebGPU.
What custom batcher patterns does pixijs-custom-rendering cover?
pixijs-custom-rendering introduces custom batchers via the Batcher extension pattern in PixiJS v8. The skill explains how to extend Batcher for specialized rendering (e.g., custom geometry, instancing), integrate custom shaders, and hook into the rendering pipeline. This unlocks performance optimization for advanced use cases beyond standard sprite and mesh rendering.
SKILL.md
rendered from the published skill — quoted content, verbatim
Custom shaders bind GLSL and WGSL programs to scene objects via Shader.from({ gl, gpu, resources }). Uniforms live in typed UniformGroups, textures are passed as separate resources, and the same shader can target both WebGL and WebGPU.
Quick Start
```ts const uniforms = new UniformGroup({ uTime: { value: 0, type: "f32" }, });
const shader = Shader.from({ gl: { vertex: vertexSrc, fragment: fragmentSrc }, resources: { uniforms }, });
const geometry = new MeshGeometry({ positions: new Float32Array([0, 0, 100,
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
skills/pixijs-custom-rendering/SKILL.md
skills/pixijs-custom-rendering/references/uniform-types.md