@neutrinoparticles/js-v1.1
v1.1.0
Published
Javascript runtime for NeutrinoParticles (JS export format v1.1)
Maintainers
Readme
@neutrinoparticles/js-v1.1
Core JavaScript runtime library for simulating NeutrinoParticles effects (format v1.1).
Installation
For most projects you should not install this package directly — install an integration package instead. It pulls this core library in as a dependency:
@neutrinoparticles/js-v1.1-pixi8— PIXI.js v8@neutrinoparticles/js-v1.1-pixi7— PIXI.js v7@neutrinoparticles/js-v1.1-phaser— Phaser 3
If you are writing a custom renderer:
npm install @neutrinoparticles/js-v1.1Export Target in Editor
In the NeutrinoParticles Editor, set the export target to JavaScript v1.1.
After export you get a .js file (e.g. my_effect.js) containing the effect model.
What Is This Package?
This is the v1.1 simulation engine. It advances particle state on the CPU and
packs the result into a data texture; the GPU reconstructs the particle
geometry in a vertex shader. The exported .js effect file references types
from this package.
Because geometry is reconstructed on the GPU, every v1.1 renderer requires a
WebGL2 context (texelFetch / integer bit ops are GLSL ES 3.00 features). The
integration packages surface this requirement in their own READMEs.
Emitter Properties
Effects can expose named properties (a colour, a rate, a direction) that the host sets at runtime. The effect instance carries the API; the integration packages forward it, so use those methods rather than touching the exported file:
effect.setPropertyInAllEmitters('MyColor', [1.0, 0.5, 0.2]);
effect.setPropertyInEmitter('Sparks', 'MyColor', [1.0, 0.5, 0.2]);
effect.getEmitterPropertyValue('Sparks', 'MyColor'); // [1.0, 0.5, 0.2]
effect.hasEmitterProperty('MyColor'); // true
effect.getEmitterProperties(); // [{ emitterName, name, arity, value }]A scalar property reads back as a number, a vector one as a number[], and an
unknown emitter or property gives undefined. Values are read live from the
simulation buffer.
Exported effects are minified. The internal names inside them are not an API — they shift between editor versions and differ between commercial and non-commercial exports. Only the methods above are stable.
v1.1 vs v1.0
v1.1 is a separate effect format with its own runtime and its own exporter
target. It is not a drop-in upgrade of v1.0 — effects must be re-exported as
JavaScript v1.1, and you must use a js-v1.1-* integration package. The
v1.0 runtime (@neutrinoparticles/js-v1.0) is unaffected and stays supported.
Documentation
Full documentation at neutrinoparticles.com.
License
Copyright (c) Yurii Miroshnyk. All rights reserved.
