NodePass.js 665 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.NodePass = function() {
  5. THREE.ShaderPass.call( this );
  6. this.textureID = 'renderTexture';
  7. this.fragment = new THREE.RawNode( new THREE.ScreenNode() );
  8. this.node = new THREE.NodeMaterial();
  9. this.node.fragment = this.fragment;
  10. this.build();
  11. };
  12. THREE.NodePass.prototype = Object.create( THREE.ShaderPass.prototype );
  13. THREE.NodePass.prototype.constructor = THREE.NodePass;
  14. THREE.NodeMaterial.addShortcuts( THREE.NodePass.prototype, 'fragment', [ 'value' ] );
  15. THREE.NodePass.prototype.build = function() {
  16. this.node.build();
  17. this.uniforms = this.node.uniforms;
  18. this.material = this.node;
  19. };