You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
739 B

6 months ago
import CondNode from '../math/CondNode.js';
import { expression } from '../code/ExpressionNode.js';
import { addNodeClass } from '../core/Node.js';
import { addNodeElement, nodeProxy } from '../shadernode/ShaderNode.js';
let discardExpression;
class DiscardNode extends CondNode {
constructor( condNode ) {
discardExpression = discardExpression || expression( 'discard' );
super( condNode, discardExpression );
}
}
export default DiscardNode;
export const inlineDiscard = nodeProxy( DiscardNode );
export const discard = ( condNode ) => inlineDiscard( condNode ).append();
addNodeElement( 'discard', discard ); // @TODO: Check... this cause a little confusing using in chaining
addNodeClass( 'DiscardNode', DiscardNode );