All Projects → Alchemist0823 → three.quarks

Alchemist0823 / three.quarks

Licence: MIT License
Three.quarks is a fast, powerful and general purpose particle engine for three.js

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to three.quarks

react-snowfetti
Generates random particles using html5 canvas API.
Stars: ✭ 17 (-29.17%)
Mutual labels:  particles
SPConfetti
Show the confetti only when the user is having fun, and if not having fun, don't show it.
Stars: ✭ 187 (+679.17%)
Mutual labels:  particles
Godot-Plugin-Particles-Renderer
A Godot plugin to render particles into a sprite sheet
Stars: ✭ 32 (+33.33%)
Mutual labels:  particles
kosm
Kosm for Android source code
Stars: ✭ 33 (+37.5%)
Mutual labels:  particles
Aboria
Enables computations over a set of particles in N-dimensional space
Stars: ✭ 83 (+245.83%)
Mutual labels:  particles
Galaxia-Runtime
Galaxy generator for Unity 3D, with Custom Particle Distributors, DirectX 11 Particles and Highly customization, curve driven Generation.
Stars: ✭ 36 (+50%)
Mutual labels:  particles
teilchen
a simple physics library based on particles, forces, constraints and behaviors
Stars: ✭ 22 (-8.33%)
Mutual labels:  particles
Newtonian-Particle-Simulator
C# OpenGL Particle Simulation, GPU accelerated
Stars: ✭ 131 (+445.83%)
Mutual labels:  particles
spark-particle-uv
Demo of how to sample the camera texture and map it to particles.
Stars: ✭ 25 (+4.17%)
Mutual labels:  particles
ParticleLib
Multiversion spigot library supporting all particles and their data (1.8-1.18.2)
Stars: ✭ 156 (+550%)
Mutual labels:  particles
Raymarched-GPU-Particles-with-Screenspace-Physics
Using Grab Passes for VRChat
Stars: ✭ 44 (+83.33%)
Mutual labels:  particles
NovaShader
Multi-functional shader for the Particle System that supports Universal Render Pipeline (URP) of Unity.
Stars: ✭ 448 (+1766.67%)
Mutual labels:  particles
SuperParticles
Amazing CPU-friendly particle network animations
Stars: ✭ 32 (+33.33%)
Mutual labels:  particles
Cabana
Performance-portable library for particle-based simulations
Stars: ✭ 115 (+379.17%)
Mutual labels:  particles
nBody
GPU-accelerated N-Body particle simulator with visualizer.
Stars: ✭ 28 (+16.67%)
Mutual labels:  particles
SwiftUI-DesignCode
 SwiftUI-DesignCode is some examples in the process of learning swiftUI 2.0
Stars: ✭ 185 (+670.83%)
Mutual labels:  particles
power-mode-input
PowerModeInput can make your text input box more compelling
Stars: ✭ 68 (+183.33%)
Mutual labels:  particles
X-Particles-Vue
A Vue.js particles plugin base on particles.js
Stars: ✭ 15 (-37.5%)
Mutual labels:  particles
bitECS
Functional, minimal, data-oriented, ultra-high performance ECS library written in JavaScript
Stars: ✭ 372 (+1450%)
Mutual labels:  particles
sparkler
Modular Macro-powered Particle System for haxe
Stars: ✭ 16 (-33.33%)
Mutual labels:  particles

three.quarks

npm test status Github Star

three.quarks is a high-performance javascript particle system based visual effect library for threejs written in modern TypeScript.

Demo

If you ever developed 3D applications on browsers, you must know the well-known WebGL library called three.js. Now you have three.quarks a high-performance particle system library with a WYSIWYG visual editor three.quarks-editor for it.

If you want the best performance please consider yarn link https://github.com/Alchemist0823/three.js. This version of three.js performs much better than official release, because it avoids unnecessary getProgramCachedKey() calls and material updates.

three.quarks Particle Engine provides following features:

  • Group Particle System
  • Batch Render Multiple Particle System (reduce draw calls) - BatchedParticleRenderer
  • Emission Shape and Control
  • Customizable Behaviors
  • Customizable RenderMode and BlendMode
  • 1D Bézier curve function for adjusting
  • Texture Atlas Animation
  • User Extension and Customization
  • A realtime editor to test and create visual effects three.quarks-editor
  • VFX json load and save

three.quarks computes most particles information on CPU, and it uses customized shader and instancing technique to render those particles. three.quarks supports 1 dimension Bezier Curves for the best transform visual effect. Most importantly, developers can customize how the particle system works by adding their own Behavior.

Examples

Launch Examples

yarn example

Check examples folder

Add particle system to the scene

const batchSystem = new BatchedParticleRenderer();
const texture = new TextureLoader().load("atlas.png");
// Particle system configuration
const muzzle = {
 duration: 1,
 looping: false,
 startLife: new IntervalValue(0.1, 0.2),
 startSpeed: new ConstantValue(0),
 startSize: new IntervalValue(1, 5),
 startColor: new ConstantColor(new Vector4(1, 1, 1, 1)),
 worldSpace: false,

 maxParticle: 5,
 emissionOverTime: new ConstantValue(0),
 emissionBursts: [{
  time: 0,
  count: 1,
  cycle: 1,
  interval: 0.01,
  probability: 1,
 }],

 shape: new PointEmitter(),
 texture: texture,
 blending: AdditiveBlending,
 startTileIndex: 91,
 uTileCount: 10,
 vTileCount: 10,
 renderOrder: 2,
 renderMode: RenderMode.LocalSpace
};

// Create particle system based on your configuration
muzzle1 = new ParticleSystem(batchSystem, {muzzle});
// developers can customize how the particle system works by 
// using existing behavior or adding their own Behavior.
muzzle1.addBehavior(new ColorOverLife(new ColorRange(new Vector4(1, 0.3882312, 0.125, 1), new Vector4(1, 0.826827, 0.3014706, 1))));
muzzle1.addBehavior(new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 0.95, 0.75, 0), 0]])));
// texture atlas animation
muzzle1.addBehavior(new FrameOverLife(new PiecewiseBezier([[new Bezier(91, 94, 97, 100), 0]])));
muzzle1.emitter.name = 'muzzle1';
muzzle1.emitter.position.x = 1;

// Add emitter to your Object3D
scene.add(muzzle1.emitter);

Add particle system update in your main loop

// update particle system
muzzle1.update(delta);
// update batched renderer
batchSystem.update();

Import VFX JSON

let loader = new QuarksLoader();
loader.setCrossOrigin("");
loader.load(jsonURL, (object3D: Object3D)=>{
    this.state.scene.add(object3D);
}, ()=>{}, ()=>{});

Note: the texture url reference is defined by the texture's name field. you may need to modify the texture url in json as needed.

Export VFX JSON

JSON.stringify(muzzle1.emitter.toJSON())
JSON.stringify(muzzle1.emitter.parent.toJSON())

three.quarks-editor

three.quarks-editor can help you preview a set of particle system at once. and you can also adjust all the particle system at real time and export those system as a JSON file. Your app or game can load those JSON file later. It even includes a Javascript scripting system to test those effect in a similar environment to your application.

Install

Package install

yarn install three.quarks

browser install

Tests

Check test folder

More examples will come up later.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].