All Projects → drawcall → Proton

drawcall / Proton

Licence: mit
Javascript particle animation library

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Proton

Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: ✭ 1,858 (-5.11%)
Mutual labels:  webgl, particles, canvas
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (-14.2%)
Mutual labels:  webgl, particles, canvas
Konfetti
Celebrate more with this lightweight confetti particle system 🎊
Stars: ✭ 2,278 (+16.34%)
Mutual labels:  particles, canvas, particle-system
Skqw
JavaScript Audio Visualizer
Stars: ✭ 112 (-94.28%)
Mutual labels:  webgl, canvas
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-92.24%)
Mutual labels:  webgl, canvas
Phenomenon
⚡️ A fast 2kB low-level WebGL API.
Stars: ✭ 1,551 (-20.79%)
Mutual labels:  webgl, particles
Sky Shader
☀️ WebGL sky and sun shader editor
Stars: ✭ 90 (-95.4%)
Mutual labels:  webgl, particle
Freeciv Web
Freeciv-web is an Open Source strategy game implemented in HTML5 and WebGL, which can be played online against other players, or in single player mode against AI opponents.
Stars: ✭ 1,626 (-16.96%)
Mutual labels:  webgl, canvas
Knowledge
文档着重构建一个完整的「前端技术架构图谱」,方便 F2E(Front End Engineering又称FEE、F2E) 学习与进阶。
Stars: ✭ 1,620 (-17.26%)
Mutual labels:  webgl, canvas
Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-93.72%)
Mutual labels:  webgl, canvas
Earthjs
D3 Earth JS
Stars: ✭ 128 (-93.46%)
Mutual labels:  webgl, canvas
Canvas Test
🎮 happy canvas
Stars: ✭ 1,722 (-12.05%)
Mutual labels:  particles, canvas
Particleeffectforugui
Render particle effect in UnityUI(uGUI). Maskable, sortable, and no extra Camera/RenderTexture/Canvas.
Stars: ✭ 1,941 (-0.87%)
Mutual labels:  particle, particle-system
React Particle Effect Button
Bursting particle effect buttons for React 🎉
Stars: ✭ 1,385 (-29.26%)
Mutual labels:  particles, canvas
Partykals
Particles system library for THREE.js
Stars: ✭ 109 (-94.43%)
Mutual labels:  webgl, particles
Fe Daily Record
📚前端书籍汇集点 + 每日好文推荐 + 公开课学习资料 + 各种大会资料
Stars: ✭ 94 (-95.2%)
Mutual labels:  webgl, canvas
Canvas Confetti
🎉 on-demand confetti gun
Stars: ✭ 2,394 (+22.27%)
Mutual labels:  particles, canvas
R3f Next Starter
Repo is moving to https://github.com/pmndrs/react-three-next
Stars: ✭ 137 (-93%)
Mutual labels:  webgl, canvas
Phaser Ce
Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
Stars: ✭ 1,186 (-39.43%)
Mutual labels:  webgl, canvas
React Tint
A React component that applies image processing filters to an image using Processing
Stars: ✭ 89 (-95.45%)
Mutual labels:  webgl, canvas

Proton is a lightweight and powerful Javascript particle animation library. Use it to easily create a variety of cool particle effects.

Check out examples at http://drawcall.github.io/Proton/. The 3D version of the proton engine is here https://github.com/drawcall/three.proton/

Features

  • Easy to use It takes only a dozen lines of code to create a particle animation effect.
  • Multiple effects Use Proton to create flames, fireworks, bullets, explosions, and more.
  • Any scene You can use it in frameworks such as react, vue, angular, and pixi.js, Phaser, etc.
  • Efficient rendering Its rendering efficiency is very high, you can render tens of thousands of particles in the page.
  • Simulated physics Proton can simulate various physical properties including gravity and Brownian motion.
  • Several renderers Proton provides a variety of renderers, of course you can also customize your own renderer
    • CanvasRenderer - Proton's canvas renderer
    • DomRenderer - Proton's dom renderer, supporting hardware acceleration.
    • WebGLRenderer - Proton's webgl renderer.
    • PixelRenderer - Proton's pixel renderer, It can implement pixel animation.
    • EaselRenderer - Easeljs proton renderer.
    • EaselRenderer - Pixi.js proton renderer.
    • CustomRenderer - Use a custom renderer that can be applied to any scene.

Documentation

See detailed documentation please visit https://projects.jpeer.at/proton/. Thank you very much @matsu7089 for writing a good tutorial.

Installation

Install using npm

Note: NPM package-name has been changed from proton-js to proton-engine

npm install proton-engine --save
import Proton from "proton-engine";

OR include in html

<script type="text/javascript" src="js/proton.min.js"></script>

Usage

Proton is very simple to use, a dozen lines of code can create a particle animation.

const proton = new Proton();
const emitter = new Proton.Emitter();

//set Rate
emitter.rate = new Proton.Rate(Proton.getSpan(10, 20), 0.1);

//add Initialize
emitter.addInitialize(new Proton.Radius(1, 12));
emitter.addInitialize(new Proton.Life(2, 4));
emitter.addInitialize(new Proton.Velocity(3, Proton.getSpan(0, 360), "polar"));

//add Behaviour
emitter.addBehaviour(new Proton.Color("ff0000", "random"));
emitter.addBehaviour(new Proton.Alpha(1, 0));

//set emitter position
emitter.p.x = canvas.width / 2;
emitter.p.y = canvas.height / 2;
emitter.emit(5);

//add emitter to the proton
proton.addEmitter(emitter);

// add canvas renderer
const renderer = new Proton.CanvasRenderer(canvas);
proton.addRenderer(renderer);

Remarks

  • Proton.Span (or Proton.getSpan) is a very important concept of the Proton engine, it's everywhere. If you understand its usage, you can create almost any desired effect!

  • If you want to create wind, rain, or snow, etc, you can use the emitter.preEmit method to pre-render the scene.

  • Use Proton.Body and Proton.Color at the same time. I suggest you'd better use the WebGLRenderer not CanvasRenderer.

  • Added Proton.Cyclone behavior, you can make vortex effects with Cyclone. Demo please check here.

  • proton.fps In most cases, you don't need to set this property. You can set this property when the game engine has fixed fps or some browsers have a higher refresh rate.

  • Use Euler integration calculation is more accurate (default false) Proton.USE_CLOCK = false or true;.

Proton has now been upgraded to the v4 version. Performance has been greatly improved and api also has some improvements. For more details, please check here.

Building

node is a dependency, use terminal to install it with:

git clone git://github.com/drawcall/Proton.git

...
npm install
npm run build

And run example

npm start
//vist http://localhost:3001/example/

Changelog

Detailed changes for each release are documented in the release notes.

License

Proton is released under the MIT License. http://www.opensource.org/licenses/mit-license

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].