FogNode.js 474 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.isFogNode = true;
  7. this.colorNode = colorNode;
  8. this.factorNode = factorNode;
  9. }
  10. mix( outputNode ) {
  11. return new MathNode( MathNode.MIX, outputNode, this.colorNode, this );
  12. }
  13. generate( builder ) {
  14. return this.factorNode.build( builder, 'float' );
  15. }
  16. }
  17. export default FogNode;