getUniformFromNode method

dynamic getUniformFromNode(
  1. dynamic node,
  2. dynamic shaderStage,
  3. dynamic type
)

Implementation

getUniformFromNode(node, shaderStage, type) {
  Map nodeData = this.getDataFromNode(node, shaderStage);

  var nodeUniform = nodeData["uniform"];

  if (nodeUniform == undefined) {
    var index = this.uniforms["index"]++;

    nodeUniform = new NodeUniform('nodeUniform${index}', type, node);

    this.uniforms[shaderStage].add(nodeUniform);

    nodeData["uniform"] = nodeUniform;
  }

  return nodeUniform;
}