pixijs-blend-modes

Apply GPU blend equations to PixiJS DisplayObjects for compositing.

Updated Mar 13, 2022
One-click install
npx skills add https://github.com/alexkafer/alexkafer-web --skill pixijs-blend-modes-alexkafer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-blend-modes
Source: https://github.com/alexkafer/alexkafer-web/tree/main/.agents/skills/pixijs-blend-modes
Command: npx skills add https://github.com/alexkafer/alexkafer-web --skill pixijs-blend-modes-alexkafer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of getting correct visual compositing in PixiJS when you need objects to blend in specific ways instead of just layering normally.

Core Features & Use Cases

  • Standard GPU blend modes: Apply common blend equations like normal, add, multiply, screen, erase, min, and max efficiently for glow, shadows, and stylized effects.
  • Advanced blend modes (extension-based): Enable richer blends such as overlay, hard-light, color-burn, and color-dodge via pixi.js/advanced-blend-modes, including the required WebGL back-buffer setup.
  • Batch-friendly ordering: Reduce performance cost by grouping identical blendMode siblings together to minimize render batch breaks.
  • Use Case: Create a layered VFX scene where sprites with “add” should behave like lights, sprites with “multiply” behave like shadows, and select sprites use “overlay” or “color-burn” for cinematic contrast.

Quick Start

Set each display object's blendMode (for example add, multiply, or color-burn) and ensure advanced modes are enabled with the extension import and WebGL init back-buffer enabled.

Frequently Asked Questions about pixijs-blend-modes

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

FAQPage Schema
How do I apply blend modes to PixiJS sprites for visual effects?

To apply blend modes to PixiJS sprites, set the blendMode property on the container or display objects. Standard GPU modes like add and multiply work natively, while advanced modes require importing the pixi.js/advanced-blend-modes extension.

Why does my WebGL rendering performance drop when using multiple blend modes?

WebGL rendering performance drops because different blend modes break render batches. Grouping display objects with identical blend modes adjacent to each other minimizes batch breaks and reduces draw calls, optimizing GPU rendering performance.

Can I use advanced blend modes like overlay and color-burn in PixiJS?

Yes, you can use advanced blend modes like overlay and color-burn in PixiJS by importing the pixi.js/advanced-blend-modes extension. This requires WebGL back-buffer support to be enabled during initialization for correct compositing.

What's the best way to composite real-time VFX layers in PixiJS?

The best way to composite real-time VFX layers in PixiJS is using GPU blend equations. Assign add for lights, multiply for shadows, and overlay for cinematic contrast, keeping like-modes adjacent in the render order for efficient batch processing.

Do I need WebGL back-buffer support for PixiJS compositing?

Yes, WebGL back-buffer support is required when using extension-backed advanced blend modes in PixiJS. Standard GPU blend equations work without it, but modes like hard-light and color-dodge need the back-buffer enabled for correct visual output.

What standard GPU blend equations does PixiJS support for UI rendering?

PixiJS supports standard GPU blend equations including normal, add, multiply, screen, erase, min, and max. These modes efficiently handle UI rendering effects and stylized visual layering without requiring additional extensions.