Giter Site home page Giter Site logo

geolehmann / three-shadenodeloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donmccurdy/three-shadenodeloader

0.0 0.0 0.0 13.34 MB

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

Home Page: https://three-shadenodeloader.donmccurdy.com/

License: MIT License

JavaScript 25.52% HTML 6.40% Lua 38.89% GLSL 12.38% ShaderLab 16.81%

three-shadenodeloader's Introduction

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 )

);

three-shadenodeloader's People

Contributors

donmccurdy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.