|
@@ -6,6 +6,7 @@ import WebGLPhysicalContextNode from './WebGLPhysicalContextNode.js';
|
|
|
|
|
|
import { PerspectiveCamera, ShaderChunk, ShaderLib, UniformsUtils, UniformsLib,
|
|
|
LinearEncoding, RGBAFormat, UnsignedByteType, sRGBEncoding } from 'three';
|
|
|
+import MathNode from '../../../nodes/math/MathNode.js';
|
|
|
|
|
|
const nodeFrame = new NodeFrame();
|
|
|
nodeFrame.camera = new PerspectiveCamera();
|
|
@@ -18,6 +19,10 @@ const nodeShaderLib = {
|
|
|
MeshPhysicalMaterial: ShaderLib.physical
|
|
|
};
|
|
|
|
|
|
+const glslMethods = {
|
|
|
+ [ MathNode.ATAN2 ]: 'atan'
|
|
|
+};
|
|
|
+
|
|
|
function getIncludeSnippet( name ) {
|
|
|
|
|
|
return `#include <${name}>`;
|
|
@@ -43,6 +48,12 @@ class WebGLNodeBuilder extends NodeBuilder {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ getMethod( method ) {
|
|
|
+
|
|
|
+ return glslMethods[ method ] || method;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
addSlot( shaderStage, slotNode ) {
|
|
|
|
|
|
this.slots[ shaderStage ].push( slotNode );
|