OSDN Git Service

639d9271d244e76bc6207b41cec014772c2f88eb
[webglgame/webgl_framework.git] / webglFramework / Thirdparty / three.js-master / examples / js / nodes / utils / NoiseNode.js
1 /**
2  * @author sunag / http://www.sunag.com.br/
3  */
4
5 THREE.NoiseNode = function( coord ) {
6
7         THREE.TempNode.call( this, 'fv1' );
8
9         this.coord = coord;
10
11 };
12
13 THREE.NoiseNode.prototype = Object.create( THREE.TempNode.prototype );
14 THREE.NoiseNode.prototype.constructor = THREE.NoiseNode;
15
16 THREE.NoiseNode.prototype.generate = function( builder, output ) {
17
18         builder.include( 'snoise' );
19
20         return builder.format( 'snoise(' + this.coord.build( builder, 'v2' ) + ')', this.getType( builder ), output );
21
22 };