FogNode.js 485 B

12345678910111213141516171819202122232425262728293031
  1. import Node from '../core/Node.js';
  2. import MathNode from '../math/MathNode.js';
  3. class FogNode extends Node {
  4. constructor( colorNode, factorNode ) {
  5. super( 'float' );
  6. this.colorNode = colorNode;
  7. this.factorNode = factorNode;
  8. }
  9. mix( outputNode ) {
  10. return new MathNode( MathNode.MIX, outputNode, this.colorNode, this );
  11. }
  12. generate( builder ) {
  13. return this.factorNode.build( builder, 'float' );
  14. }
  15. }
  16. FogNode.prototype.isFogNode = true;
  17. export default FogNode;