NoiseNode.js 500 B

12345678910111213141516171819202122
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.NoiseNode = function( coord ) {
  5. THREE.TempNode.call( this, 'fv1' );
  6. this.coord = coord;
  7. };
  8. THREE.NoiseNode.prototype = Object.create( THREE.TempNode.prototype );
  9. THREE.NoiseNode.prototype.constructor = THREE.NoiseNode;
  10. THREE.NoiseNode.prototype.generate = function( builder, output ) {
  11. builder.include( 'snoise' );
  12. return builder.format( 'snoise(' + this.coord.build( builder, 'v2' ) + ')', this.getType( builder ), output );
  13. };