NodeBuilder constructor

NodeBuilder(
  1. dynamic object,
  2. dynamic renderer,
  3. dynamic parser
)

Implementation

NodeBuilder(object, renderer, parser) {
  this.object = object;
  this.material = object.material;
  this.renderer = renderer;
  this.parser = parser ?? new WGSLNodeParser();

  this.nodes = [];
  this.updateNodes = [];
  this.hashNodes = {};

  // this.vertexShader = null;
  // this.fragmentShader = null;

  this.flowNodes = {"vertex": [], "fragment": []};
  this.flowCode = {"vertex": '', "fragment": ''};
  this.uniforms = {"vertex": [], "fragment": [], "index": 0};
  this.codes = {"vertex": [], "fragment": []};
  this.attributes = [];
  this.varys = [];
  this.vars = {"vertex": [], "fragment": []};
  this.flow = {"code": ''};
  this.stack = [];

  this.context = {
    "keywords": new NodeKeywords(),
    "material": object.material
  };

  this.nodesData = new WeakMap();
  this.flowsData = new WeakMap();

  this.shaderStage = null;
  this.node = null;
}