October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

How to Build a Cross-Engine Particle System for PixiJS and Three.js

Build a renderer-independent particle simulation, then adapt its state to PixiJS ParticleContainer or Three.js Points without sharing engine objects.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To use the same particle system in PixiJS and Three.js, share the simulation—not the rendered objects. Put particle state, emitter rules, and time handling in an engine-neutral module, then write one adapter for PixiJS and another for Three.js. Each adapter turns the same state into objects or GPU buffers its renderer understands.

Can I share particle simulation logic between PixiJS and Three.js?

Yes. Share the rules that determine what particles do: when they spawn, how position and velocity change, when they expire, and which properties they carry. Do not try to share PixiJS display objects with Three.js. PixiJS has its own renderer and scene graph; Three.js represents point clouds with objects such as Points, backed by BufferGeometry and a material.

As an Amazon Associate I earn from qualifying purchases.

A useful boundary looks like this:

  • Simulation core: plain data and functions for spawning, updating, expiring, and recycling particles.
  • PixiJS adapter: creates and updates PixiJS particles and containers, and owns textures and their lifecycle.
  • Three.js adapter: creates and updates Three.js geometry, materials, and scene objects.

The simulation contract is yours to define; neither framework supplies a shared cross-engine particle schema. Keeping it plain also makes the core testable without creating a renderer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should the shared particle data contain?

Start with only the values your effect needs. A 2D spark might not need a z coordinate; a Three.js point cloud usually does. An example TypeScript contract is:

#1 Best Overall
2Pcs Raspberry Pi Pico Development Board, Raspberry Pi RP2040 Dual-core ARM Cortex M0+ Processor, Running Up to 133 MHz, Support C/C++/Python, 2MB Quad SPI Flash Integrated with SPI/I2C/UART Interface
  • The Raspberry Pi Pico is a beginner-friendly microcontroller board that uses MicroPython to give you a taste of the Internet of Things and microcontrollers. The RP2040 is a well-designed microprocessor that can be utilized in almost any Internet of Things project. It has enough power to complete the task quickly.
  • 【Raspberry Pi RP2040 Microcontroller】Raspberry Pi Pico features Dual-core ARM Cortex M0+ processor, flexible clock running up to 133 MHz. With 264KB of SRAM, and 2MB of on-board Flash memory.Supports up to 16 MB of off chip flash memory via a dedicated QSPI bus
  • 【Multiple Software Support】Pico has rich and complete software support, it comes with a complete Rasberry Pi official C/C++ SDK, Micropython SDK.The programming and burning of Pico need to be carried out on the computer. Supported operating systems and computers include:Raspberry Pie with Raspberry Pi OS,Other platforms equipped with Debian based Linux system Computer with MacOS, Computers with Windows, etc.
  • 【Rich Hardware Interface】Raspberry Pi Pico has 30 GPIO pins, 4 pins for analog signal input and 26 × multi-function GPIO pins, 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels.USB 1.1 supported by host and device, The installation mode can be flexibly selected by users to facilitate welding with other development boards.
  • 【Build Project in Tiny Size】Only 2.1cm*5.1cm ( as small as your thumb). Pico has been designed to use either soldered 0.1" pin-headers or can be used as a surface-mountable 'module'.
type Particle = {
  x: number;
  y: number;
  z: number;
  vx: number;
  vy: number;
  vz: number;
  age: number;
  lifetime: number;
  size: number;
  rotation: number;
  opacity: number;
  color: number;
};

type Emitter = {
  particlesPerSecond: number;
  lifetimeSeconds: number;
  initialSpeed: number;
};

This is an application-level example, not a PixiJS or Three.js API. Extend it with spawn shape, burst count, size or color ranges, and behavior parameters only as required. Keep texture objects, materials, geometry, renderer references, and framework-specific callbacks out of the core.

Have the core own the particle collection and expose the active values to adapters. For many particles, typed arrays can reduce object overhead and make it straightforward to copy values into rendering buffers. The choice between records and typed arrays is an implementation trade-off; the important property is that the representation does not depend on either engine.

How should particle time be updated?

Pass elapsed time into the simulation explicitly, in seconds. Avoid basing lifetime on a renderer’s implicit frame count: frame rates vary, and a particle should not live twice as long merely because one device draws fewer frames.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
With Pre-Soldered Header Raspberry Pi Pico Microcontroller Development Board Based on Raspberry Pi RP2040 Chip,Dual-Core ARM Cortex M0+ Processor
  • with pre-soldered header Raspberry Pi Pico. RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom
  • Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz. 264KB of SRAM, and 2MB of on-board Flash memory.
  • Castellated module allows soldering direct to carrier boards. USB 1.1 with device and host support. Low-power sleep and dormant modes. Drag-and-drop programming using mass storage over USB. 26 × multi-function GPIO pins.
  • 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels.Accurate clock and timer on-chip.Temperature sensor.
  • Accelerated floating-point libraries on-chip.8 × Programmable I/O (PIO) state machines for custom peripheral support

For simple effects, advance by measured elapsed time and clamp unusually large gaps, such as when a tab resumes after being inactive. For effects that need more repeatable motion across frame rates, use a fixed-step accumulator:

const step = 1 / 60;
let accumulator = 0;

function frame(elapsedSeconds: number) {
  accumulator += Math.min(elapsedSeconds, 0.1);

  while (accumulator >= step) {
    simulation.update(step);
    accumulator -= step;
  }

  pixiAdapter.sync(simulation);
  threeAdapter.sync(simulation);
}

The example caps a single frame’s accumulated time at 0.1 seconds and advances the core in 1/60-second steps. Those are illustrative policy choices, not framework requirements. If smooth rendering between fixed simulation steps matters, retain previous and current states and interpolate in the adapter.

PixiJS’s ticker is one possible source of elapsed time, but check the installed major version. PixiJS v8 changed the ticker callback to receive a Ticker instance; use its version-appropriate delta property rather than copying older callback examples. Convert the value to seconds according to the exact API semantics in your installed version before passing it to a seconds-based core.

Rank #3
LAFVIN PICO Development Kit for Raspberry Pi Pico/Pico W/2/2W with Tutorial
  • ALL-IN-ONE INTERACTIVE DEVELOPMENT KIT: Combines a 3.5-inch 320×480 capacitive touchscreen, Mini PSP joystick, RGB LED, buzzer, and two buttons for interactive Pico projects.
  • WIDE PICO COMPATIBILITY: Designed for Raspberry Pi Pico, Pico W, Pico 2, and Pico 2W series boards. Plug in a compatible Pico and start developing without soldering.
  • TOUCHSCREEN & CONTROLS: Create calculators, menus, control panels, games, and graphical interfaces using the 3.5-inch capacitive touchscreen, joystick, and dual buttons.
  • GPIO & POWER EXPANSION: Provides full 40-pin GPIO access plus 3.3V and 5V power interfaces, making it convenient to connect additional hardware for DIY projects.
  • BUILT FOR STEM & DIY: Equipped with online documents and video tutorials for comprehensive guidance; suitable for STEAM classrooms, allowing students to make their own Pico small computer in 10 minutes, perfect for programming learning and project practice.

How do I render the shared particles in PixiJS?

For PixiJS v8, the documented high-volume route is ParticleContainer with Particle. The PixiJS guide describes this API as experimental, so keep its use inside the adapter and verify the exact API against the version you pin. Do not make the simulation depend on it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create and configure the PixiJS objects in the adapter. Load or receive textures, create the particle container, and establish the mapping from core particles to PixiJS particles.
  2. Enable updates for the properties that actually change. If the simulation changes position, rotation, or color, configure those properties as dynamic for the installed API. Avoid updating attributes that remain constant.
  3. Synchronize after advancing the core. Copy active particle values into the corresponding PixiJS particles, then let the PixiJS renderer draw them.
  4. Dispose of renderer-owned resources at the edge. The adapter should own the container lifecycle and coordinate texture cleanup according to how those textures are shared elsewhere in the application.

PixiJS separates rendering, its container/scene graph, assets, and ticker responsibilities. Keeping asset loading and display-object creation in the adapter means the core can still run in a unit test or feed a different renderer.

How do I render the same particles in Three.js?

For point-like particles, use Three.js Points. Its documented constructor takes a BufferGeometry and a material. The adapter can store each particle’s position in a geometry position attribute and update that attribute from the simulation before rendering.

// Three.js adapter sketch; positions is a Float32Array with 3 values per particle.
const positions = new Float32Array(maxParticles * 3);
const geometry = new THREE.BufferGeometry();
geometry.setAttribute(
  "position",
  new THREE.BufferAttribute(positions, 3)
);

const points = new THREE.Points(geometry, material);

function syncParticles(particles: Particle[]) {
  for (let i = 0; i < particles.length; i++) {
    const particle = particles[i];
    positions[i * 3] = particle.x;
    positions[i * 3 + 1] = particle.y;
    positions[i * 3 + 2] = particle.z;
  }

  geometry.attributes.position.needsUpdate = true;
}

This sketch assumes a fixed-capacity buffer and that the active particles occupy the first entries. A production adapter must also handle active counts, capacity growth or overflow, and disposal of geometry and material. Those policies belong to the adapter, not the simulation.

Points suits point-cloud-style particles. If the effect needs camera-facing textured quads or full 3D meshes, choose a different presentation strategy and implement it as a separate adapter. The cited API facts establish Points as a documented option; they do not establish that it is faster than sprites or instanced geometry in a particular scene.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I handle 2D and 3D coordinates?

Matching particle data does not automatically make the two renderings look alike. Decide whether the simulation itself is two-dimensional or three-dimensional, then make the conversion explicit at the renderer boundary.

Best Value
LAFVIN Basic Starter Kit for Raspberry Pi Development Board Breadboard LCD1602 Module Python C Java Scratch Beginner Kit
  • The Basic Starter Kit for Raspberry Pi offers detailed learning courses for beginners.
  • It provides many components that allow you to create a variety of different projects.
  • Compatible with Raspberry Pi 5/4B/3B+/3B/Zero W/Zero /400.
  • 4 programming languages Python C Java Scratch.
  • We are constantly improving our tutorials to enhance the customer experience.
  • 2D simulation rendered in Three.js: choose a plane and camera convention, such as placing particles on a plane facing the camera. Define how simulation units map to world units.
  • 3D simulation rendered in PixiJS: project positions into 2D, and decide how depth affects apparent size, ordering, or visibility if the effect requires it.
  • Both engines show the same view: keep projection and coordinate conversion policy explicit and test it with known positions. Do not bury renderer-specific transforms in shared update rules.

These are design decisions rather than behavior guaranteed by either framework. Rotation, transparency, blending, and texture treatment can also differ between renderers, so matching the simulation is not the same as guaranteeing pixel-identical output.

How should I test the core and adapters?

Test simulation behavior separately from rendering. The core can be exercised with deterministic inputs and no PixiJS or Three.js setup.

  • Check that an emitter produces the expected number of particles over a specified interval.
  • Check that particles expire at the intended lifetime and that recycled slots do not retain stale state.
  • Check boundary behavior: whether particles are removed, wrapped, or kept when they leave the effect’s bounds.
  • Feed equivalent total elapsed time using different frame-step sequences and compare the resulting state within the tolerance your simulation expects.

Then test each adapter in its own renderer: verify property mapping, texture or material appearance, transparency, active-particle handling, and cleanup. This separates a simulation bug from a renderer or resource-lifecycle bug.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use a third-party particle emitter?

@pixi/particle-emitter describes itself as a PixiJS-oriented library with configurable emitter behavior, including optional automatic ticker updates. That makes it a possible PixiJS-side tool, not evidence of a portable simulation shared with Three.js. Its surfaced documentation is not recent enough to establish current PixiJS v8 compatibility, so verify compatibility for the exact package version before adopting it.

If cross-engine reuse is the goal, keep any emitter package behind an adapter or use it only for PixiJS-specific effects. Avoid letting an automatic ticker update the same simulation that your shared clock already advances; choose one update owner to prevent double updates.

Which rendering approach fits the effect?

Approach Best fit Key trade-off Version or evidence note
PixiJS ParticleContainer and Particle Lightweight 2D visuals in PixiJS Configure the changing properties and keep creation, synchronization, and cleanup in a PixiJS-specific adapter. PixiJS v8 guide calls the API experimental; verify against the pinned version.
Three.js Points, BufferGeometry, and a material Point-cloud-style particles in Three.js The adapter must populate and update geometry attributes and manage geometry/material lifecycle. Three.js documentation identifies Points as a point-cloud object constructed from geometry and material.
Three.js sprites or instanced geometry Textured billboards or mesh-like particles Presentation and buffer/material costs depend on the specific effect and implementation. Not compared by the cited documentation; benchmark the actual scene before making performance claims.

Compare candidate renderings by dimensionality, per-particle update needs, buffer volume, transparency and blending requirements, coordinate conversion, API stability, and disposal responsibilities. The cited documentation does not provide a head-to-head performance result, and PixiJS’s illustrative 100,000-particle sample is example code, not a measured capacity guarantee.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.