UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

21 lines (20 loc) 826 B
"use strict"; import { BaseNodeGlMathFunctionArg1GlNode } from "./_BaseMathFunction"; import { ThreeToGl } from "../../../core/ThreeToGl"; export class NullGlNode extends BaseNodeGlMathFunctionArg1GlNode { static type() { return "null"; } setLines(shaders_collection_controller) { const namedOutputConnectionPoints = this.io.outputs.namedOutputConnectionPoints(); if (!namedOutputConnectionPoints) { return; } const in_value = ThreeToGl.any(this.variableForInput(this._gl_input_name(0))); const out_connection_point = namedOutputConnectionPoints[0]; const gl_type = out_connection_point.type(); const out = this.glVarName(out_connection_point.name()); const body_line = `${gl_type} ${out} = ${in_value}`; shaders_collection_controller.addBodyLines(this, [body_line]); } }