Community코딩 & 개발github.com

pixijs/pixijs-scene-particle-container

PixiJS v8에서 수천 개의 경량 스프라이트를 렌더링할 때 사용합니다. ParticleContainer, Particle 인스턴스, addParticle/removeParticle, particleChildren 배열, dynamicProperties (vertex, position, rotation, uvs, color), boundsArea, roundPixels, update를 다룹니다.

pixijs-scene-particle-container란 무엇인가요?

이 스킬은 PixiJS v8에서 ParticleContainer를 사용하여 수천 개의 경량 스프라이트(파티클)를 효율적으로 렌더링하는 방법을 제공합니다. ParticleContainer는 기존 Container보다 메모리와 CPU 오버헤드가 적어 대규모 파티클 시스템, 폭발 효과, 별 필드, 비와 눈과 같은 시각 효과 구현에 적합합니다. Particle 인스턴스를 추가/제거하는 addParticle/removeParticle 메서드, particleChildren 배열을 통한 접근, 그리고 vertex, position, rotation, uvs, color와 같은 dynamicProperties를 통해 각 파티클의 속성을 개별적으로 제어할 수 있습니다. 또한 boundsArea, roundPixels, update 옵션을 지원하며, ParticleContainerOptions와 ParticleOptions를 통해 생성자에서 설정할 수 있습니다. PixiJS v8에서 파티클 효과를 최적화하고자 하는 개발자에게 필수적인 스킬입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/pixijs/pixijs-skills/tree/main/skills/pixijs-scene-particle-container

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

pixijs-scene-particle-container은(는) 무엇을 하나요?

이 스킬은 PixiJS v8에서 수천 개의 경량 스프라이트를 렌더링할 때 사용합니다. ParticleContainer, Particle 인스턴스, addParticle/removeParticle, particleChildren 배열, dynamicProperties (vertex, position, rotation, uvs, color), boundsArea, roundPixels, update를 다룹니다. 트리거: ParticleContainer, Particle, IParticle, addParticle, particleChildren, dynamicProperties, boundsArea, particle effects, constructor options, ParticleContainerOptions, ParticleOptions.

개요

ParticleContainer는 PixiJS v8에서 대량의 스프라이트를 효율적으로 렌더링하기 위해 특별히 설계된 컨테이너입니다. 일반 Container에 비해 메모리 사용량이 적고 렌더링 성능이 뛰어나지만, 일부 기능(예: 개별 스프라이트의 복잡한 변환)이 제한됩니다.

주요 구성 요소

ParticleContainer

ParticleContainer는 파티클을 관리하는 최상위 컨테이너입니다.

import { ParticleContainer } from 'pixi.js';

const container = new ParticleContainer({
    capacity: 10000, // 최대 파티클 수
    properties: {
        vertices: true,  // 버텍스 데이터 사용
        position: true,  // 위치 데이터 사용
        rotation: true,  // 회전 데이터 사용
        uvs: false,      // UV 좌표 사용 안 함
        color: true,     // 색상 데이터 사용
    },
    boundsArea: new Rectangle(0, 0, 800, 600),
    roundPixels: true,
});

Particle

Particle은 개별 파티클 인스턴스를 나타냅니다.

import { Particle } from 'pixi.js';

const particle = new Particle({
    texture: texture,
    position: { x: 100, y: 200 },
    rotation: 0.5,
    tint: 0xff0000,
    alpha: 0.8,
});

IParticle

IParticle 인터페이스는 파티클의 기본 속성을 정의합니다.

interface IParticle {
    position: ObservablePoint;
    rotation: number;
    scale: ObservablePoint;
    alpha: number;
    tint: number;
    visible: boolean;
    texture: Texture;
}

주요 메서드

addParticle

컨테이너에 새 파티클을 추가합니다.

const particle = container.addParticle({
    texture: particleTexture,
    position: { x: Math.random() * 800, y: Math.random() * 600 },
    tint: 0xffffff,
    alpha: 1,
});

removeParticle

컨테이너에서 파티클을 제거합니다.

container.removeParticle(particle);

particleChildren

particleChildren 속성은 컨테이너 내 모든 파티클의 배열을 반환합니다.

const children = container.particleChildren;
children.forEach((particle) => {
    particle.alpha -= 0.01;
});

동적 속성 (dynamicProperties)

dynamicProperties는 각 파티클의 속성을 개별적으로 업데이트할 수 있게 해주는 설정입니다.

속성설명기본값
vertex버텍스 데이터 사용 여부true
position위치 데이터 사용 여부true
rotation회전 데이터 사용 여부true
uvsUV 좌표 사용 여부false
color색상 데이터 사용 여부false
const container = new ParticleContainer({
    capacity: 5000,
    properties: {
        vertices: false,
        position: true,
        rotation: true,
        uvs: false,
        color: true,
    },
});

옵션

boundsArea

파티클의 경계 영역을 설정합니다. 이 영역 밖의 파티클은 렌더링되지 않아 성능이 향상됩니다.

import { Rectangle } from 'pixi.js';

container.boundsArea = new Rectangle(0, 0, 1024, 768);

roundPixels

파티클 위치를 정수로 반올림하여 픽셀 정렬을 개선합니다. 이는 성능을 약간 향상시키고 안티앨리어싱 아티팩트를 줄일 수 있습니다.

container.roundPixels = true;

update

파티클 속성이 변경된 후 컨테이너를 수동으로 업데이트할 때 사용합니다.

container.update();

생성자 옵션

ParticleContainerOptions

interface ParticleContainerOptions {
    capacity: number;
    properties?: {
        vertices?: boolean;
        position?: boolean;
        rotation?: boolean;
        uvs?: boolean;
        color?: boolean;
    };
    boundsArea?: Rectangle;
    roundPixels?: boolean;
}

ParticleOptions

interface ParticleOptions {
    texture: Texture;
    position?: { x: number; y: number };
    rotation?: number;
    scale?: { x: number; y: number };
    alpha?: number;
    tint?: number;
    visible?: boolean;
}

사용 예제

기본 파티클 효과

import { Application, ParticleContainer, Particle, Texture } from 'pixi.js';

const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);

const particleContainer = new ParticleContainer({
    capacity: 1000,
    properties: { position: true, rotation: true, color: true },
});

const texture = Texture.WHITE;
for (let i = 0; i < 500; i++) {
    const particle = particleContainer.addParticle({
        texture,
        position: {
            x: Math.random() * 800,
            y: Math.random() * 600,
        },
        rotation: Math.random() * Math.PI * 2,
        tint: Math.random() * 0xffffff,
        alpha: 0.8 + Math.random() * 0.2,
    });
}

app.stage.addChild(particleContainer);

// 애니메이션 루프에서 파티클 업데이트
app.ticker.add(() => {
    particleContainer.particleChildren.forEach((particle) => {
        particle.position.y -= 1;
        particle.rotation += 0.01;
    });
    particleContainer.update();
});

주의사항

  • ParticleContainer는 Container의 모든 기능을 지원하지 않습니다. 복잡한 개별 변환이 필요하면 일반 Container를 사용하세요.
  • dynamicProperties에서 활성화하지 않은 속성은 파티클에서 사용할 수 없습니다.
  • capacity는 컨테이너 생성 시 설정해야 하며, 이후 변경할 수 없습니다.
  • 대규모 파티클 시스템을 사용할 때는 boundsArea를 설정하여 불필요한 렌더링을 방지하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

pixijs/pixijs

Use this skill first for ANY PixiJS v8 task; it routes to the right specialized skill for the job. Covers the full PixiJS surface: Application setup, the scene graph (Container, Sprite, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite), rendering (WebGL/WebGPU/Canvas, render loop, custom shaders, filters, blend modes), assets, events, color, math, ticker, accessibility, performance, environments, migration from v7, and project scaffolding. Triggers on: pixi, pixi.js, pixijs, PixiJS, v8, Application, app.init, Sprite, Container, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite, Assets, Ticker, renderer, WebGL, WebGPU, scene graph, filter, shader, blend mode, texture, BitmapText, create-pixi, how do I draw, how do I render, how do I animate in pixi.

pixijs/pixijs-accessibility

Use this skill when adding screen reader and keyboard navigation to PixiJS v8 apps. Covers AccessibilitySystem options (enabledByDefault, debug, activateOnTab, deactivateOnMouseMove), per-container accessibility properties, shadow DOM overlay, mobile touch-hook activation. Triggers on: accessibility, a11y, screen reader, ARIA, keyboard navigation, tab order, AccessibilitySystem, accessibleTitle, accessibleHint, tabIndex, accessibleChildren.

pixijs/pixijs-application

Use this skill when creating and configuring a PixiJS v8 Application. Covers new Application() + async app.init() options (width, height, background, antialias, resolution, autoDensity, preference, resizeTo, autoStart, sharedTicker, canvas, useBackBuffer, powerPreference, eventFeatures, accessibilityOptions, gcActive, bezierSmoothness, webgl/webgpu/canvasOptions per-renderer overrides), app.stage/renderer/canvas/screen/domContainerRoot access, ResizePlugin, TickerPlugin, CullerPlugin (cullable, cullArea), custom ApplicationPlugin creation via ExtensionType.Application, start/stop lifecycle, and app.destroy() with releaseGlobalResources. Triggers on: Application, app.init, app.stage, app.renderer, app.canvas, app.screen, app.domContainerRoot, ApplicationOptions, ApplicationPlugin, ExtensionType.Application, resizeTo, preference, autoStart, sharedTicker, useBackBuffer, powerPreference, skipExtensionImports, preferWebGLVersion, preserveDrawingBuffer, cullable, CullerPlugin, app.start, app.stop, app.destroy, rele

pixijs/pixijs-assets

Use this skill when loading and managing resources in PixiJS v8. Covers Assets.init, Assets.load/add/unload, bundles, manifests, background loading, onProgress, caching, spritesheets, video textures, web fonts, bitmap fonts, animated GIFs, compressed textures, SVG as texture or Graphics, resolution detection, per-asset data options, and forcing a specific loader with the parser field (for extension-less URLs). Triggers on: Assets, Assets.load, Assets.init, loadBundle, manifest, backgroundLoad, Spritesheet, Cache, LoadOptions, unload, parser, loadParser, loadWebFont, loadBitmapFont, loadVideoTextures, GifSource, VideoSourceOptions.

pixijs/pixijs-blend-modes

Use this skill when compositing display objects with blend modes in PixiJS v8. Covers standard modes (normal, add, multiply, screen, erase, min, max), advanced modes via pixi.js/advanced-blend-modes (color-burn, overlay, hard-light, etc.), batch-friendly ordering. Triggers on: blendMode, additive, multiply, screen, overlay, color-burn, color-dodge, advanced-blend-modes, glow, erase.

pixijs/pixijs-color

Use this skill when creating, converting, or manipulating colors in PixiJS v8. Covers Color class input formats (hex, CSS names, RGB/HSL objects, arrays, Uint8Array), conversion methods (toHex, toNumber, toArray, toRgba), component access, setAlpha/multiply/premultiply, Color.shared singleton. Triggers on: Color, ColorSource, hex, rgb, hsl, tint, premultiply, Color.shared, color conversion.

pixijs/pixijs-core-concepts

Use this skill when understanding how PixiJS v8 renders frames: the systems-and-pipes renderer, the render loop, and how the library adapts to different environments. Covers WebGLRenderer/WebGPURenderer/CanvasRenderer selection, renderer.render() pipeline, environment detection, and pointers to per-topic deep dives. Triggers on: renderer, WebGL, WebGPU, Canvas, render loop, render pipeline, systems, environments, autoDetectRenderer.

pixijs/pixijs-create

Use this skill when scaffolding a new PixiJS v8 project with the create-pixi CLI or adding PixiJS to an existing project. Covers npm/yarn/pnpm/bun create commands, interactive vs non-interactive flows, bundler vs creation template categories, available template presets (bundler-vite, bundler-webpack, bundler-esbuild, bundler-import-map, creation-web, framework-react, extension-default), Node version requirements, `npm install pixi.js` for existing projects, post-scaffold dev flow, and the Vite top-level-await production-build gotcha. Triggers on: create pixi.js, npm create, npm install pixi.js, scaffold, template, bundler-vite, bundler-webpack, creation-web, framework-react, new project, existing project, getting started, quick start.

pixijs/pixijs-custom-rendering

Use this skill when writing custom shaders, uniforms, filters, or batchers in PixiJS v8. Covers Shader.from({gl, gpu, resources}), GlProgram/GpuProgram, UniformGroup with typed uniforms (f32, vec2, mat4x4), UBO mode, textures as resources, custom Filter via Filter.from, GLSL ES 3.0 conventions (in/out, finalColor, texture()), uBackTexture sampling, pixi.js/unsafe-eval for strict CSP, custom Batcher via extensions. Triggers on: Shader, GlProgram, GpuProgram, UniformGroup, Batcher, Filter, Filter.from, GLSL, WGSL, UBO, uniform, custom shader, finalColor, uBackTexture, blendRequired, unsafe-eval.

pixijs/pixijs-environments

Use this skill when running PixiJS v8 outside a standard browser: Web Workers, OffscreenCanvas, Node/SSR, or CSP-restricted contexts. Covers DOMAdapter.set, BrowserAdapter, WebWorkerAdapter, custom Adapter interface, pixi.js/unsafe-eval for strict CSP. Triggers on: DOMAdapter, BrowserAdapter, WebWorkerAdapter, Web Worker, OffscreenCanvas, Node, headless, SSR, CSP, unsafe-eval, Adapter.

pixijs/pixijs-events

Use this skill when handling pointer, mouse, touch, or wheel input in PixiJS v8. Covers eventMode (none, passive, auto, static, dynamic), FederatedEvent types, propagation and capture phase, hitArea, interactiveChildren, cursor and cursorStyles, global move events for drag, eventFeatures config. Triggers on: eventMode, FederatedPointerEvent, pointerdown, click, tap, globalpointermove, drag, hitArea, cursor, stopPropagation.

pixijs/pixijs-filters

Use this skill when applying visual effects to PixiJS v8 containers via the filter pipeline. Covers built-in filters (AlphaFilter, BlurFilter, ColorMatrixFilter, DisplacementFilter, NoiseFilter), custom Filter.from() with GLSL/WGSL, options (resolution, padding, antialias, blendRequired), filterArea optimization, pixi-filters community package. Triggers on: filters, BlurFilter, ColorMatrixFilter, DisplacementFilter, NoiseFilter, Filter.from, GLSL filter, pixi-filters, filterArea.

pixijs/pixijs-math

Use this skill when working with coordinates, vectors, matrices, shapes, hit testing, or layout rectangles in PixiJS v8. Covers Point/ObservablePoint, Matrix (2D affine, decompose, apply, applyInverse), shapes (Rectangle, Circle, Ellipse, Polygon, RoundedRectangle, Triangle), Rectangle layout helpers (pad, fit, enlarge, ceil, scale, getBounds), strokeContains hit tests, Polygon isClockwise/containsPolygon, toGlobal/toLocal, PointData/PointLike/Size types, DEG_TO_RAD, and pixi.js/math-extras vector and intersection helpers. Triggers on: Point, ObservablePoint, Matrix, Rectangle, Circle, Polygon, Triangle, RoundedRectangle, toGlobal, toLocal, hitArea, strokeContains, pad, fit, enlarge, ceil, getBounds, containsRect, intersects, isClockwise, math-extras, lineIntersection, segmentIntersection, DEG_TO_RAD, PointData.

pixijs/pixijs-migration-v8

Use this skill when upgrading to PixiJS v8 from v7 or diagnosing broken v7 code after an upgrade. Covers async app.init, single pixi.js package (deprecated @pixi/* sub-packages), Graphics shape-then-fill, BaseTexture → TextureSource, shader/uniform rework, ParticleContainer+Particle, constructor options objects, DisplayObject removal, settings/utils removal, Ticker signature, events rewrite. Triggers on: migrate v7, v8 breaking changes, @pixi/ import, DisplayObject, beginFill, endFill, cacheAsBitmap, BaseTexture, deprecated.

pixijs/pixijs-performance

Use this skill when profiling or optimizing a PixiJS v8 app for FPS, draw calls, or GPU memory. Covers destroy patterns (cacheAsTexture(false), releaseGlobalResources), GCSystem and TextureGCSystem, PrepareSystem, object pooling, batching rules, BitmapText for dynamic text, culling (Culler, CullerPlugin, cullable, cullArea), resolution/antialias tradeoffs. Triggers on: FPS, jank, draw calls, batching, object pool, GCSystem, PrepareSystem, Culler, cacheAsTexture, memory leak, destroy patterns.

pixijs/pixijs-scene-container

Use this skill when grouping, positioning, or transforming display objects in PixiJS v8. Covers Container constructor options (isRenderGroup, sortableChildren, boundsArea), addChild/removeChild/addChildAt/swapChildren/setChildIndex, position/scale/rotation/pivot/skew/alpha/tint, getBounds/getGlobalPosition/toLocal/toGlobal, zIndex sorting, cullable, onRender per-frame callback, destroy. Triggers on: Container, addChild, removeChild, addChildAt, swapChildren, sortableChildren, zIndex, position, scale, rotation, pivot, getBounds, toGlobal, toLocal, onRender, destroy, constructor options, ContainerOptions.

pixijs/pixijs-scene-core-concepts

Use this skill when reasoning about the PixiJS v8 scene graph as a whole: how containers, leaves, transforms, and render order fit together. Covers leaf vs container distinction, local/world coordinates, culling, render groups, sortable children, masking, RenderLayer, constructor options shared by every scene node, and which leaf skill covers which display object. Triggers on: scene graph, display list, Container, Sprite, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite, masking, render group, RenderLayer, world transform, constructor options, ContainerOptions.

pixijs/pixijs-scene-dom-container

Use this skill when overlaying HTML elements on the PixiJS v8 canvas. Covers DOMContainer with element, anchor, and scene-graph-driven CSS transforms, the pixi.js/dom side-effect import, DOMPipe registration, visibility sync, pointer-events handling. Triggers on: DOMContainer, pixi.js/dom, DOMPipe, HTML overlay, input on canvas, iframe overlay, DOMContainerOptions, element, anchor, constructor options.

pixijs/pixijs-scene-gif

Use this skill when displaying animated GIFs in PixiJS v8. Covers the pixi.js/gif side-effect import, Assets.load returning a GifSource, GifSprite playback (play/stop/currentFrame/animationSpeed), autoPlay/loop options, onComplete/onLoop/onFrameChange callbacks, GifSource sharing, clone, destroy. Triggers on: GifSprite, GifSource, pixi.js/gif, animationSpeed, currentFrame, autoPlay, onComplete, onFrameChange, constructor options, GifSpriteOptions.

pixijs/pixijs-scene-graphics

Use this skill when drawing vector shapes and paths in PixiJS v8. Covers the Graphics API: shape-then-fill methods (rect/circle/ellipse/poly/roundRect/star/regularPoly/roundPoly/roundShape/filletRect/chamferRect), path methods (moveTo/lineTo/bezierCurveTo/quadraticCurveTo/arc/arcTo/arcToSvg/closePath), fill/stroke/cut, holes, FillGradient (linear/radial), FillPattern, GraphicsContext sharing, svg import/export, containsPoint hit testing, cloning, clearing, bounds, fillStyle/strokeStyle, draw-time transforms (rotateTransform/scaleTransform/translateTransform/setTransform/save/restore), default styles, GraphicsPath reuse. Triggers on: Graphics, GraphicsContext, rect, circle, poly, roundRect, fill, stroke, cut, hole, beginHole, FillGradient, FillPattern, moveTo, bezierCurveTo, svg, graphicsContextToSvg, svg export, GraphicsOptions, containsPoint, clone, clear, bounds, rotateTransform, translateTransform, setFillStyle, setStrokeStyle, GraphicsPath.

관련 스킬