Skip to content
[EXPERIMENTAL] three.js loader for shaders created with Shade app for iOS
Lua JavaScript ShaderLab GLSL HTML
Branch: master
Clone or download
Latest commit 9086f85 Mar 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Reorganize assets. Mar 10, 2019
nodes Add Voronoi3DNode, Clamp01Node, NormalizeNode. Mar 10, 2019
.gitignore Add .gitignore. Jan 23, 2019
LICENSE Create LICENSE Jan 28, 2019
README.md Update README.md Mar 11, 2019
ShadeNodeLoader.js Clean up. Mar 10, 2019
index.html lol typos Mar 10, 2019
now.json Disable env map for now, just adds weight Mar 10, 2019
package-lock.json Bump three Feb 4, 2019
package.json Add some attribution. Mar 10, 2019

README.md

THREE.ShadeNodeLoader

Status License

three.js loader for shaders created with Shade app for iOS.

const loader = new ShadeNodeLoader();

const sceneTime = new TimerNode();

// Some node types (time, microphone input, props, etc.) need to be
// provided by the application. Use the `.setFactory()` method to configure
// a callback for creating these nodes.
loader.setFactory( ( nodeDef ) => {

  switch ( nodeDef.class ) {

    case 'TimeNode':
      return sceneTime;

    default:
      throw new Error(`Unknown type: ${nodeDef.class}.`);

  }

} );

// The load callback returns a THREE.NodeMaterial instance, ready to be
// used in a mesh. Additional properties created by the loader may be
// visible in `material.userData`, such as:
// - needsDerivatives: Derivatives must be enabled on the material.
// - needsBarycentric: Barycentric coordinates must be added to the geometry.
// - instanceCount: Requires a THREE.InstanceBufferGeometry with the given count.
loader.load(

  'shaders/Dissolve/Graph.json',

  ( material ) => scene.add( new THREE.Mesh( new THREE.TorusKnotBufferGeometry(), material ) ),

  ( event ) => console.info( event ),

  ( error ) => console.error( error )

);
You can’t perform that action at this time.