Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 )

);

About

[EXPERIMENTAL] three.js loader for shaders created with Shade app for iOS

Resources

License

Releases

No releases published
You can’t perform that action at this time.