All Projects → vaneenige → Three.phenomenon

vaneenige / Three.phenomenon

Licence: mit
⭐️ A tiny wrapper around three.js built for high-performance WebGL experiences.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Three.phenomenon

Sky Shader
☀️ WebGL sky and sun shader editor
Stars: ✭ 90 (-73.37%)
Mutual labels:  webgl, threejs, shader
Three Nebula
WebGL based particle system engine for three.js
Stars: ✭ 192 (-43.2%)
Mutual labels:  webgl, threejs, particles
Three.meshline
Mesh replacement for THREE.Line
Stars: ✭ 1,644 (+386.39%)
Mutual labels:  webgl, threejs, shader
Magicshader
🔮 Tiny helper for three.js to debug and write shaders
Stars: ✭ 205 (-39.35%)
Mutual labels:  webgl, threejs, shader
Partykals
Particles system library for THREE.js
Stars: ✭ 109 (-67.75%)
Mutual labels:  webgl, threejs, particles
Phenomenon Px
⚡️ The fastest way to create pixel shaders.
Stars: ✭ 77 (-77.22%)
Mutual labels:  wrapper, webgl, shader
Enable3d
🕹️ Standalone 3D Framework / Physics for three.js (using ammo.js) / 3D extension for Phaser 3
Stars: ✭ 271 (-19.82%)
Mutual labels:  webgl, threejs
Three Globe
WebGL Globe Data Visualization as a ThreeJS reusable 3D object
Stars: ✭ 270 (-20.12%)
Mutual labels:  webgl, threejs
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-17.75%)
Mutual labels:  webgl, threejs
Moonrider
🌕🏄🏿 Surf the musical road among the stars. Side project built by two people in a few months to demonstrate WebXR.
Stars: ✭ 292 (-13.61%)
Mutual labels:  webgl, threejs
Gl Water2d
2D liquid simulation in WebGL
Stars: ✭ 260 (-23.08%)
Mutual labels:  webgl, particles
Glmaps
Data visualization examples and tutorials from scratch. 数据可视化示例代码集与新手学习教程。
Stars: ✭ 288 (-14.79%)
Mutual labels:  webgl, threejs
Modv
modular audio visualisation powered by JavaScript
Stars: ✭ 292 (-13.61%)
Mutual labels:  webgl, shader
Three.proton
three.proton is a magical 3d particle engine using three.js library. It is based on the Proton engine library.
Stars: ✭ 327 (-3.25%)
Mutual labels:  threejs, particles
Dino3d
🦖 Google Chrome T-Rex Run! in 3D (WebGL experiment)
Stars: ✭ 263 (-22.19%)
Mutual labels:  webgl, threejs
Livecodelab
a web based livecoding environment
Stars: ✭ 276 (-18.34%)
Mutual labels:  webgl, threejs
React Three Editable
👀 ✏️ Edit your react-three-fiber scene with a visual editor without giving up control over your code.
Stars: ✭ 261 (-22.78%)
Mutual labels:  webgl, threejs
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+976.92%)
Mutual labels:  shader, particles
React Postprocessing
📬 postprocessing for react-three-fiber
Stars: ✭ 311 (-7.99%)
Mutual labels:  webgl, threejs
Gpu Particles
A GPU Particle System for Unity
Stars: ✭ 313 (-7.4%)
Mutual labels:  shader, particles

THREE.Phenomenon

npm version gzip size license dependencies TypeScript

THREE.Phenomenon is a tiny wrapper around three.js built for high-performance WebGL experiences.

With it's simple API a mesh can be created that contains multiple instances of a geometry combined with a material. With access to the vertex shader, attributes per instance and uniforms this mesh can be transformed in any way possible (and on the GPU).

Features:

  • Below 1kb in size (gzip)
  • Custom instanced geometries
  • Attributes for every instance
  • Support for default materials
  • Compatible with three.js r104

Install

$ npm install --save three.phenomenon

Usage

// Import the library
import Phenomenon from 'three.phenomenon';

// Create an instance
Phenomenon({ ... });

The wrapper is also available through THREE.Phenomenon.

API

Phenomenon(options)

Returns an instance of Phenomenon.

The instance provides access to the mesh (with the compiled vertex and fragment shader) and uniforms.

options.attributes

Type: Array

Values used in the program that are stored once, directly on the GPU. Every item in this array needs to have a:

  • name for referencing data in the vertex shader.
  • data function to create the data for each instance.
  • size so it's clear what comes back from the data.

The data function receives the index of the current instance and the total number of instances so calculations can be done based on these values.

options.uniforms

Type: Object

Variables used in the program that can be adjusted on the fly. These are accessible through the instance variable and can be updated directly.

options.vertex

Type: String

The vertex shader of the program which will calculate the position of every instance. This will automatically get merged with the shaders that's created based on the provided geometry.

options.fragment

Type: Array

The fragment parameter is optional and can be used to modify specific parts of the provided material's fragment shader. For example: Give every instance a unique color or manually use its position for calculations.

options.geometry

Type: THREE.Geometry

The geometry that will be multiplied. See Geometry for more information.

options.material

Type: THREE.Material

The material that is used for the geometry. See Material for more information.

options.multiplier

Type: Number
The amount of instances that will be created.

options.castShadow

Type: Boolean
Should the mesh cast a shadow?

Contribute

Are you excited about this library and have interesting ideas on how to improve it? Please tell me or contribute directly!

npm install > npm start > http://localhost:8080

License

MIT © Colin van Eenige

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