super-three 0.155.0 → 0.157.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +361 -324
- package/build/three.js +361 -324
- package/build/three.min.js +2 -2
- package/build/three.module.js +354 -323
- package/build/three.module.min.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +17 -0
- package/examples/jsm/controls/DragControls.js +3 -2
- package/examples/jsm/controls/OrbitControls.js +13 -5
- package/examples/jsm/csm/CSMShader.js +59 -21
- package/examples/jsm/exporters/EXRExporter.js +102 -24
- package/examples/jsm/exporters/GLTFExporter.js +1 -1
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +8726 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +8737 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/tween.module.js +790 -735
- package/examples/jsm/libs/utif.module.js +1644 -1558
- package/examples/jsm/lights/LightProbeGenerator.js +37 -3
- package/examples/jsm/lines/LineMaterial.js +90 -156
- package/examples/jsm/loaders/3DMLoader.js +378 -104
- package/examples/jsm/loaders/DDSLoader.js +46 -3
- package/examples/jsm/loaders/EXRLoader.js +4 -4
- package/examples/jsm/loaders/FBXLoader.js +2 -0
- package/examples/jsm/loaders/GLTFLoader.js +18 -8
- package/examples/jsm/loaders/KTX2Loader.js +126 -77
- package/examples/jsm/loaders/LDrawLoader.js +22 -16
- package/examples/jsm/loaders/LogLuvLoader.js +2 -2
- package/examples/jsm/loaders/MMDLoader.js +10 -7
- package/examples/jsm/loaders/RGBELoader.js +48 -66
- package/examples/jsm/loaders/STLLoader.js +7 -0
- package/examples/jsm/loaders/USDZLoader.js +215 -12
- package/examples/jsm/materials/MeshGouraudMaterial.js +22 -18
- package/examples/jsm/nodes/Nodes.js +8 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +30 -4
- package/examples/jsm/nodes/accessors/BufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/CameraNode.js +1 -1
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +19 -4
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +4 -5
- package/examples/jsm/nodes/accessors/InstanceNode.js +2 -2
- package/examples/jsm/nodes/accessors/LineMaterialNode.js +29 -0
- package/examples/jsm/nodes/accessors/MaterialNode.js +23 -13
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +12 -9
- package/examples/jsm/nodes/accessors/ModelNode.js +1 -1
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +5 -4
- package/examples/jsm/nodes/accessors/MorphNode.js +4 -4
- package/examples/jsm/nodes/accessors/NormalNode.js +1 -1
- package/examples/jsm/nodes/accessors/Object3DNode.js +3 -3
- package/examples/jsm/nodes/accessors/PointUVNode.js +1 -1
- package/examples/jsm/nodes/accessors/PositionNode.js +1 -1
- package/examples/jsm/nodes/accessors/ReferenceNode.js +13 -7
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +2 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +2 -2
- package/examples/jsm/nodes/accessors/SkinningNode.js +2 -2
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/TangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +18 -8
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +29 -0
- package/examples/jsm/nodes/accessors/UVNode.js +1 -1
- package/examples/jsm/nodes/accessors/UserDataNode.js +2 -2
- package/examples/jsm/nodes/code/CodeNode.js +1 -1
- package/examples/jsm/nodes/code/ExpressionNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionCallNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionNode.js +18 -7
- package/examples/jsm/nodes/code/ScriptableNode.js +2 -2
- package/examples/jsm/nodes/code/ScriptableValueNode.js +2 -2
- package/examples/jsm/nodes/core/ArrayUniformNode.js +1 -1
- package/examples/jsm/nodes/core/AttributeNode.js +3 -3
- package/examples/jsm/nodes/core/BypassNode.js +1 -1
- package/examples/jsm/nodes/core/CacheNode.js +1 -1
- package/examples/jsm/nodes/core/ConstNode.js +1 -1
- package/examples/jsm/nodes/core/ContextNode.js +2 -2
- package/examples/jsm/nodes/core/IndexNode.js +1 -1
- package/examples/jsm/nodes/core/InputNode.js +1 -1
- package/examples/jsm/nodes/core/Node.js +45 -14
- package/examples/jsm/nodes/core/NodeBuilder.js +83 -15
- package/examples/jsm/nodes/core/NodeFrame.js +37 -14
- package/examples/jsm/nodes/core/NodeUniform.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +62 -0
- package/examples/jsm/nodes/core/PropertyNode.js +3 -1
- package/examples/jsm/nodes/core/StackNode.js +5 -5
- package/examples/jsm/nodes/core/StructTypeNode.js +24 -0
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/core/UniformNode.js +3 -1
- package/examples/jsm/nodes/core/VarNode.js +1 -1
- package/examples/jsm/nodes/core/VaryingNode.js +1 -1
- package/examples/jsm/nodes/core/constants.js +1 -1
- package/examples/jsm/nodes/display/BlendModeNode.js +2 -2
- package/examples/jsm/nodes/display/BumpMapNode.js +2 -2
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +2 -2
- package/examples/jsm/nodes/display/ColorSpaceNode.js +2 -2
- package/examples/jsm/nodes/display/FrontFacingNode.js +1 -1
- package/examples/jsm/nodes/display/NormalMapNode.js +2 -2
- package/examples/jsm/nodes/display/PosterizeNode.js +2 -2
- package/examples/jsm/nodes/display/ToneMappingNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportNode.js +21 -7
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportTextureNode.js +1 -1
- package/examples/jsm/nodes/fog/FogExp2Node.js +2 -2
- package/examples/jsm/nodes/fog/FogNode.js +2 -2
- package/examples/jsm/nodes/fog/FogRangeNode.js +2 -2
- package/examples/jsm/nodes/geometry/RangeNode.js +2 -2
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +1 -1
- package/examples/jsm/nodes/lighting/AONode.js +2 -2
- package/examples/jsm/nodes/lighting/AmbientLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +2 -2
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/IESSpotLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightingContextNode.js +3 -3
- package/examples/jsm/nodes/lighting/LightingNode.js +1 -1
- package/examples/jsm/nodes/lighting/LightsNode.js +4 -4
- package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/SpotLightNode.js +4 -4
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +449 -0
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +54 -0
- package/examples/jsm/nodes/materials/Materials.js +2 -0
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +6 -6
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/NodeMaterial.js +39 -29
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +2 -2
- package/examples/jsm/nodes/math/CondNode.js +1 -1
- package/examples/jsm/nodes/math/HashNode.js +34 -0
- package/examples/jsm/nodes/math/MathNode.js +2 -2
- package/examples/jsm/nodes/math/OperatorNode.js +1 -1
- package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
- package/examples/jsm/nodes/shadernode/ShaderNode.js +85 -28
- package/examples/jsm/nodes/utils/ArrayElementNode.js +1 -1
- package/examples/jsm/nodes/utils/ConvertNode.js +1 -1
- package/examples/jsm/nodes/utils/DiscardNode.js +1 -1
- package/examples/jsm/nodes/utils/EquirectUVNode.js +2 -2
- package/examples/jsm/nodes/utils/JoinNode.js +1 -1
- package/examples/jsm/nodes/utils/LoopNode.js +11 -11
- package/examples/jsm/nodes/utils/MatcapUVNode.js +2 -2
- package/examples/jsm/nodes/utils/MaxMipLevelNode.js +1 -1
- package/examples/jsm/nodes/utils/OscNode.js +2 -2
- package/examples/jsm/nodes/utils/PackingNode.js +2 -2
- package/examples/jsm/nodes/utils/RemapNode.js +2 -2
- package/examples/jsm/nodes/utils/RotateUVNode.js +2 -2
- package/examples/jsm/nodes/utils/SetNode.js +62 -0
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +2 -2
- package/examples/jsm/nodes/utils/SplitNode.js +2 -2
- package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +2 -2
- package/examples/jsm/nodes/utils/TimerNode.js +2 -2
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +2 -2
- package/examples/jsm/objects/Sky.js +1 -3
- package/examples/jsm/postprocessing/FilmPass.js +3 -5
- package/examples/jsm/postprocessing/OutputPass.js +3 -2
- package/examples/jsm/postprocessing/RenderPass.js +30 -12
- package/examples/jsm/postprocessing/SAOPass.js +23 -98
- package/examples/jsm/postprocessing/SSAOPass.js +10 -30
- package/examples/jsm/renderers/common/Backend.js +11 -8
- package/examples/jsm/renderers/common/Background.js +2 -2
- package/examples/jsm/renderers/common/Binding.js +6 -0
- package/examples/jsm/renderers/common/Bindings.js +4 -5
- package/examples/jsm/renderers/common/Pipelines.js +9 -9
- package/examples/jsm/renderers/common/RenderContext.js +3 -0
- package/examples/jsm/renderers/common/RenderContexts.js +26 -1
- package/examples/jsm/renderers/common/RenderList.js +12 -4
- package/examples/jsm/renderers/common/RenderObject.js +43 -15
- package/examples/jsm/renderers/common/RenderObjects.js +8 -14
- package/examples/jsm/renderers/common/Renderer.js +52 -16
- package/examples/jsm/renderers/common/SampledTexture.js +6 -3
- package/examples/jsm/renderers/common/Sampler.js +1 -1
- package/examples/jsm/renderers/common/StorageBuffer.js +1 -1
- package/examples/jsm/renderers/common/StorageTexture.js +19 -0
- package/examples/jsm/renderers/common/Textures.js +166 -21
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +35 -0
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +21 -11
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +1 -7
- package/examples/jsm/renderers/common/nodes/Nodes.js +79 -18
- package/examples/jsm/renderers/webgl/WebGLBackend.js +702 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +207 -20
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +84 -0
- package/examples/jsm/renderers/webgl/utils/WebGLExtensions.js +26 -0
- package/examples/jsm/renderers/webgl/utils/WebGLState.js +529 -0
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +212 -0
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +242 -0
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +340 -0
- package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodeBuilder.js +4 -4
- package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodes.js +14 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +282 -43
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +18 -2
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +93 -60
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +2 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +15 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +39 -14
- package/examples/jsm/renderers/webgpu/utils/WebGPUTexturePassUtils.js +285 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +205 -284
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +6 -5
- package/examples/jsm/shaders/FilmShader.js +11 -54
- package/examples/jsm/shaders/GammaCorrectionShader.js +1 -1
- package/examples/jsm/shaders/MMDToonShader.js +4 -4
- package/examples/jsm/shaders/OutputShader.js +2 -2
- package/examples/jsm/shaders/SAOShader.js +0 -13
- package/examples/jsm/shaders/SSAOShader.js +33 -26
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +6 -6
- package/examples/jsm/utils/BufferGeometryUtils.js +6 -4
- package/package.json +1 -1
- package/src/Three.js +1 -2
- package/src/animation/AnimationUtils.js +3 -20
- package/src/animation/KeyframeTrack.js +8 -8
- package/src/audio/Audio.js +6 -0
- package/src/cameras/Camera.js +1 -5
- package/src/cameras/CubeCamera.js +14 -8
- package/src/constants.js +10 -1
- package/src/core/Object3D.js +1 -14
- package/src/core/RenderTarget.js +16 -7
- package/src/core/UniformsGroup.js +2 -2
- package/src/extras/core/CurvePath.js +4 -1
- package/src/loaders/DataTextureLoader.js +0 -2
- package/src/loaders/MaterialLoader.js +1 -1
- package/src/loaders/ObjectLoader.js +6 -0
- package/src/materials/Material.js +10 -10
- package/src/math/Color.js +1 -5
- package/src/math/ColorManagement.js +82 -60
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +3 -3
- package/src/math/Vector4.js +4 -4
- package/src/objects/Line.js +1 -1
- package/src/objects/Mesh.js +1 -1
- package/src/objects/Points.js +1 -1
- package/src/objects/Sprite.js +2 -2
- package/src/renderers/WebGLRenderer.js +42 -51
- package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +35 -2
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +19 -15
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +11 -6
- package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +16 -16
- package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +11 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/background.glsl.js +8 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -1
- package/src/renderers/shaders/UniformsUtils.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +9 -17
- package/src/renderers/webgl/WebGLLights.js +14 -3
- package/src/renderers/webgl/WebGLProgram.js +36 -5
- package/src/renderers/webgl/WebGLPrograms.js +9 -1
- package/src/renderers/webgl/WebGLTextures.js +19 -8
- package/src/renderers/webgl/WebGLUtils.js +25 -20
- package/src/scenes/Fog.js +1 -0
- package/src/scenes/FogExp2.js +1 -0
- package/src/textures/Source.js +2 -2
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +9 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureMipmapUtils.js +0 -163
- package/src/lights/AmbientLightProbe.js +0 -21
- package/src/lights/HemisphereLightProbe.js +0 -30
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/SlotNode.js +0 -0
|
@@ -16,6 +16,7 @@ import { lightsWithoutWrap } from '../lighting/LightsNode.js';
|
|
|
16
16
|
import { mix, dFdx, dFdy } from '../math/MathNode.js';
|
|
17
17
|
import { float, vec3, vec4 } from '../shadernode/ShaderNode.js';
|
|
18
18
|
import AONode from '../lighting/AONode.js';
|
|
19
|
+
import { lightingContext } from '../lighting/LightingContextNode.js';
|
|
19
20
|
import EnvironmentNode from '../lighting/EnvironmentNode.js';
|
|
20
21
|
|
|
21
22
|
const NodeMaterials = new Map();
|
|
@@ -28,7 +29,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
28
29
|
|
|
29
30
|
this.isNodeMaterial = true;
|
|
30
31
|
|
|
31
|
-
this.type = this.constructor.
|
|
32
|
+
this.type = this.constructor.type;
|
|
32
33
|
|
|
33
34
|
this.forceSinglePass = false;
|
|
34
35
|
|
|
@@ -64,17 +65,17 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
64
65
|
|
|
65
66
|
build( builder ) {
|
|
66
67
|
|
|
67
|
-
this.
|
|
68
|
+
this.setup( builder );
|
|
68
69
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
setup( builder ) {
|
|
72
73
|
|
|
73
74
|
// < VERTEX STAGE >
|
|
74
75
|
|
|
75
76
|
builder.addStack();
|
|
76
77
|
|
|
77
|
-
builder.stack.outputNode = this.
|
|
78
|
+
builder.stack.outputNode = this.setupPosition( builder );
|
|
78
79
|
|
|
79
80
|
builder.addFlow( 'vertex', builder.removeStack() );
|
|
80
81
|
|
|
@@ -86,14 +87,14 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
86
87
|
|
|
87
88
|
if ( this.unlit === false ) {
|
|
88
89
|
|
|
89
|
-
if ( this.normals === true ) this.
|
|
90
|
+
if ( this.normals === true ) this.setupNormal( builder );
|
|
90
91
|
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
92
|
+
this.setupDiffuseColor( builder );
|
|
93
|
+
this.setupVariants( builder );
|
|
93
94
|
|
|
94
|
-
const outgoingLightNode = this.
|
|
95
|
+
const outgoingLightNode = this.setupLighting( builder );
|
|
95
96
|
|
|
96
|
-
outputNode = this.
|
|
97
|
+
outputNode = this.setupOutput( builder, vec4( outgoingLightNode, diffuseColor.a ) );
|
|
97
98
|
|
|
98
99
|
// OUTPUT NODE
|
|
99
100
|
|
|
@@ -105,7 +106,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
105
106
|
|
|
106
107
|
} else {
|
|
107
108
|
|
|
108
|
-
outputNode = this.
|
|
109
|
+
outputNode = this.setupOutput( builder, this.outputNode || vec4( 0, 0, 0, 1 ) );
|
|
109
110
|
|
|
110
111
|
}
|
|
111
112
|
|
|
@@ -115,7 +116,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
115
116
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
setupPosition( builder ) {
|
|
119
120
|
|
|
120
121
|
const object = builder.object;
|
|
121
122
|
const geometry = object.geometry;
|
|
@@ -152,7 +153,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
152
153
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
setupDiffuseColor( { stack, geometry } ) {
|
|
156
157
|
|
|
157
158
|
let colorNode = this.colorNode ? vec4( this.colorNode ) : materialColor;
|
|
158
159
|
|
|
@@ -185,20 +186,20 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
185
186
|
|
|
186
187
|
}
|
|
187
188
|
|
|
188
|
-
|
|
189
|
+
setupVariants( /*builder*/ ) {
|
|
189
190
|
|
|
190
191
|
// Interface function.
|
|
191
192
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
setupNormal( { stack } ) {
|
|
195
196
|
|
|
196
197
|
// NORMAL VIEW
|
|
197
198
|
|
|
198
199
|
if ( this.flatShading === true ) {
|
|
199
200
|
|
|
200
201
|
const fdx = dFdx( positionView );
|
|
201
|
-
const fdy = dFdy( positionView
|
|
202
|
+
const fdy = dFdy( positionView );
|
|
202
203
|
const normalNode = fdx.cross( fdy ).normalize();
|
|
203
204
|
|
|
204
205
|
stack.assign( transformedNormalView, normalNode );
|
|
@@ -235,7 +236,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
235
236
|
|
|
236
237
|
}
|
|
237
238
|
|
|
238
|
-
|
|
239
|
+
setupLights( builder ) {
|
|
239
240
|
|
|
240
241
|
const envNode = this.getEnvNode( builder );
|
|
241
242
|
|
|
@@ -267,13 +268,13 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
267
268
|
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
|
|
271
|
+
setupLightingModel( /*builder*/ ) {
|
|
271
272
|
|
|
272
273
|
// Interface function.
|
|
273
274
|
|
|
274
275
|
}
|
|
275
276
|
|
|
276
|
-
|
|
277
|
+
setupLighting( builder ) {
|
|
277
278
|
|
|
278
279
|
const { material } = builder;
|
|
279
280
|
const { backdropNode, backdropAlphaNode, emissiveNode } = this;
|
|
@@ -282,15 +283,15 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
282
283
|
|
|
283
284
|
const lights = this.lights === true || this.lightsNode !== null;
|
|
284
285
|
|
|
285
|
-
const lightsNode = lights ? this.
|
|
286
|
+
const lightsNode = lights ? this.setupLights( builder ) : null;
|
|
286
287
|
|
|
287
288
|
let outgoingLightNode = diffuseColor.rgb;
|
|
288
289
|
|
|
289
290
|
if ( lightsNode && lightsNode.hasLight !== false ) {
|
|
290
291
|
|
|
291
|
-
const lightingModelNode = this.
|
|
292
|
+
const lightingModelNode = this.setupLightingModel( builder );
|
|
292
293
|
|
|
293
|
-
outgoingLightNode =
|
|
294
|
+
outgoingLightNode = lightingContext( lightsNode, lightingModelNode, backdropNode, backdropAlphaNode );
|
|
294
295
|
|
|
295
296
|
} else if ( backdropNode !== null ) {
|
|
296
297
|
|
|
@@ -302,7 +303,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
302
303
|
|
|
303
304
|
if ( ( emissiveNode && emissiveNode.isNode === true ) || ( material.emissive && material.emissive.isColor === true ) ) {
|
|
304
305
|
|
|
305
|
-
outgoingLightNode = outgoingLightNode.add( emissiveNode ?
|
|
306
|
+
outgoingLightNode = outgoingLightNode.add( vec3( emissiveNode ? emissiveNode : materialEmissive ) );
|
|
306
307
|
|
|
307
308
|
}
|
|
308
309
|
|
|
@@ -310,7 +311,7 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
310
311
|
|
|
311
312
|
}
|
|
312
313
|
|
|
313
|
-
|
|
314
|
+
setupOutput( builder, outputNode ) {
|
|
314
315
|
|
|
315
316
|
const renderer = builder.renderer;
|
|
316
317
|
|
|
@@ -344,7 +345,15 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
344
345
|
|
|
345
346
|
if ( renderTarget !== null ) {
|
|
346
347
|
|
|
347
|
-
|
|
348
|
+
if ( Array.isArray( renderTarget.texture ) ) {
|
|
349
|
+
|
|
350
|
+
outputColorSpace = renderTarget.texture[ 0 ].colorSpace;
|
|
351
|
+
|
|
352
|
+
} else {
|
|
353
|
+
|
|
354
|
+
outputColorSpace = renderTarget.texture.colorSpace;
|
|
355
|
+
|
|
356
|
+
}
|
|
348
357
|
|
|
349
358
|
} else {
|
|
350
359
|
|
|
@@ -512,12 +521,13 @@ class NodeMaterial extends ShaderMaterial {
|
|
|
512
521
|
|
|
513
522
|
export default NodeMaterial;
|
|
514
523
|
|
|
515
|
-
export function addNodeMaterial( nodeMaterial ) {
|
|
524
|
+
export function addNodeMaterial( type, nodeMaterial ) {
|
|
516
525
|
|
|
517
|
-
if ( typeof nodeMaterial !== 'function' || !
|
|
518
|
-
if ( NodeMaterials.has(
|
|
526
|
+
if ( typeof nodeMaterial !== 'function' || ! type ) throw new Error( `Node material ${ type } is not a class` );
|
|
527
|
+
if ( NodeMaterials.has( type ) ) throw new Error( `Redefinition of node material ${ type }` );
|
|
519
528
|
|
|
520
|
-
NodeMaterials.set(
|
|
529
|
+
NodeMaterials.set( type, nodeMaterial );
|
|
530
|
+
nodeMaterial.type = type;
|
|
521
531
|
|
|
522
532
|
}
|
|
523
533
|
|
|
@@ -533,4 +543,4 @@ export function createNodeMaterialFromType( type ) {
|
|
|
533
543
|
|
|
534
544
|
}
|
|
535
545
|
|
|
536
|
-
addNodeMaterial( NodeMaterial );
|
|
546
|
+
addNodeMaterial( 'NodeMaterial', NodeMaterial );
|
|
@@ -38,7 +38,7 @@ class SpriteNodeMaterial extends NodeMaterial {
|
|
|
38
38
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
setupPosition( { object, context } ) {
|
|
42
42
|
|
|
43
43
|
// < VERTEX STAGE >
|
|
44
44
|
|
|
@@ -100,4 +100,4 @@ class SpriteNodeMaterial extends NodeMaterial {
|
|
|
100
100
|
|
|
101
101
|
export default SpriteNodeMaterial;
|
|
102
102
|
|
|
103
|
-
addNodeMaterial( SpriteNodeMaterial );
|
|
103
|
+
addNodeMaterial( 'SpriteNodeMaterial', SpriteNodeMaterial );
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
|
+
import { addNodeElement, nodeProxy } from '../shadernode/ShaderNode.js';
|
|
3
|
+
|
|
4
|
+
class HashNode extends Node {
|
|
5
|
+
|
|
6
|
+
constructor( seedNode ) {
|
|
7
|
+
|
|
8
|
+
super();
|
|
9
|
+
|
|
10
|
+
this.seedNode = seedNode;
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
setup( /*builder*/ ) {
|
|
15
|
+
|
|
16
|
+
// Taken from https://www.shadertoy.com/view/XlGcRh, originally from pcg-random.org
|
|
17
|
+
|
|
18
|
+
const state = this.seedNode.uint().mul( 747796405 ).add( 2891336453 );
|
|
19
|
+
const word = state.shiftRight( state.shiftRight( 28 ).add( 4 ) ).bitXor( state ).mul( 277803737 );
|
|
20
|
+
const result = word.shiftRight( 22 ).bitXor( word );
|
|
21
|
+
|
|
22
|
+
return result.float().mul( 1 / 2 ** 32 ); // Convert to range [0, 1)
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default HashNode;
|
|
29
|
+
|
|
30
|
+
export const hash = nodeProxy( HashNode );
|
|
31
|
+
|
|
32
|
+
addNodeElement( 'hash', hash );
|
|
33
|
+
|
|
34
|
+
addNodeClass( 'HashNode', HashNode );
|
|
@@ -102,7 +102,7 @@ class MathNode extends TempNode {
|
|
|
102
102
|
|
|
103
103
|
} else if ( method === MathNode.NEGATE ) {
|
|
104
104
|
|
|
105
|
-
return builder.format( '-' + a.build( builder, inputType ), type, output );
|
|
105
|
+
return builder.format( '( - ' + a.build( builder, inputType ) + ' )', type, output );
|
|
106
106
|
|
|
107
107
|
} else if ( method === MathNode.ONE_MINUS ) {
|
|
108
108
|
|
|
@@ -356,4 +356,4 @@ addNodeElement( 'faceForward', faceForward );
|
|
|
356
356
|
addNodeElement( 'difference', difference );
|
|
357
357
|
addNodeElement( 'saturate', saturate );
|
|
358
358
|
|
|
359
|
-
addNodeClass( MathNode );
|
|
359
|
+
addNodeClass( 'MathNode', MathNode );
|
|
@@ -25,9 +25,9 @@ class CheckerNode extends TempNode {
|
|
|
25
25
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
setup() {
|
|
29
29
|
|
|
30
|
-
return checkerShaderNode( { uv: this.uvNode } )
|
|
30
|
+
return checkerShaderNode( { uv: this.uvNode } );
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,4 +39,4 @@ export const checker = nodeProxy( CheckerNode );
|
|
|
39
39
|
|
|
40
40
|
addNodeElement( 'checker', checker );
|
|
41
41
|
|
|
42
|
-
addNodeClass( CheckerNode );
|
|
42
|
+
addNodeClass( 'CheckerNode', CheckerNode );
|
|
@@ -3,6 +3,7 @@ import ArrayElementNode from '../utils/ArrayElementNode.js';
|
|
|
3
3
|
import ConvertNode from '../utils/ConvertNode.js';
|
|
4
4
|
import JoinNode from '../utils/JoinNode.js';
|
|
5
5
|
import SplitNode from '../utils/SplitNode.js';
|
|
6
|
+
import SetNode from '../utils/SetNode.js';
|
|
6
7
|
import ConstNode from '../core/ConstNode.js';
|
|
7
8
|
import { getValueFromType, getValueType } from '../core/NodeUtils.js';
|
|
8
9
|
|
|
@@ -17,9 +18,11 @@ export function addNodeElement( name, nodeElement ) {
|
|
|
17
18
|
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
const parseSwizzle = ( props ) => props.replace( /r|s/g, 'x' ).replace( /g|t/g, 'y' ).replace( /b|p/g, 'z' ).replace( /a|q/g, 'w' );
|
|
22
|
+
|
|
20
23
|
const shaderNodeHandler = {
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
setup( NodeClosure, params ) {
|
|
23
26
|
|
|
24
27
|
const inputs = params.shift();
|
|
25
28
|
|
|
@@ -37,6 +40,10 @@ const shaderNodeHandler = {
|
|
|
37
40
|
|
|
38
41
|
return ( ...params ) => nodeElement( nodeObj, ...params );
|
|
39
42
|
|
|
43
|
+
} else if ( prop === 'self' ) {
|
|
44
|
+
|
|
45
|
+
return node;
|
|
46
|
+
|
|
40
47
|
} else if ( prop.endsWith( 'Assign' ) && NodeElements.has( prop.slice( 0, prop.length - 'Assign'.length ) ) ) {
|
|
41
48
|
|
|
42
49
|
const nodeElement = NodeElements.get( prop.slice( 0, prop.length - 'Assign'.length ) );
|
|
@@ -47,19 +54,31 @@ const shaderNodeHandler = {
|
|
|
47
54
|
|
|
48
55
|
// accessing properties ( swizzle )
|
|
49
56
|
|
|
50
|
-
prop = prop
|
|
51
|
-
.replace( /r|s/g, 'x' )
|
|
52
|
-
.replace( /g|t/g, 'y' )
|
|
53
|
-
.replace( /b|p/g, 'z' )
|
|
54
|
-
.replace( /a|q/g, 'w' );
|
|
57
|
+
prop = parseSwizzle( prop );
|
|
55
58
|
|
|
56
59
|
return nodeObject( new SplitNode( node, prop ) );
|
|
57
60
|
|
|
58
|
-
} else if ( prop
|
|
61
|
+
} else if ( /^set[XYZWRGBASTPQ]{1,4}$/.test( prop ) === true ) {
|
|
62
|
+
|
|
63
|
+
// set properties ( swizzle )
|
|
64
|
+
|
|
65
|
+
prop = parseSwizzle( prop.slice( 3 ).toLowerCase() );
|
|
66
|
+
|
|
67
|
+
// sort to xyzw sequence
|
|
68
|
+
|
|
69
|
+
prop = prop.split( '' ).sort().join( '' );
|
|
70
|
+
|
|
71
|
+
return ( value ) => nodeObject( new SetNode( node, prop, value ) );
|
|
72
|
+
|
|
73
|
+
} else if ( prop === 'width' || prop === 'height' || prop === 'depth' ) {
|
|
59
74
|
|
|
60
75
|
// accessing property
|
|
61
76
|
|
|
62
|
-
|
|
77
|
+
if ( prop === 'width' ) prop = 'x';
|
|
78
|
+
else if ( prop === 'height' ) prop = 'y';
|
|
79
|
+
else if ( prop === 'depth' ) prop = 'z';
|
|
80
|
+
|
|
81
|
+
return nodeObject( new SplitNode( node, prop ) );
|
|
63
82
|
|
|
64
83
|
} else if ( /^\d+$/.test( prop ) === true ) {
|
|
65
84
|
|
|
@@ -177,42 +196,86 @@ const ShaderNodeImmutable = function ( NodeClass, ...params ) {
|
|
|
177
196
|
|
|
178
197
|
};
|
|
179
198
|
|
|
180
|
-
class
|
|
199
|
+
class ShaderCallNodeInternal extends Node {
|
|
181
200
|
|
|
182
|
-
constructor(
|
|
201
|
+
constructor( shaderNode, inputNodes ) {
|
|
183
202
|
|
|
184
203
|
super();
|
|
185
204
|
|
|
186
|
-
this.
|
|
205
|
+
this.shaderNode = shaderNode;
|
|
206
|
+
this.inputNodes = inputNodes;
|
|
187
207
|
|
|
188
208
|
}
|
|
189
209
|
|
|
190
|
-
|
|
210
|
+
getNodeType( builder ) {
|
|
191
211
|
|
|
192
|
-
|
|
212
|
+
const { outputNode } = builder.getNodeProperties( this );
|
|
193
213
|
|
|
194
|
-
return
|
|
214
|
+
return outputNode ? outputNode.getNodeType( builder ) : super.getNodeType( builder );
|
|
195
215
|
|
|
196
216
|
}
|
|
197
217
|
|
|
198
|
-
|
|
218
|
+
call( builder ) {
|
|
199
219
|
|
|
200
|
-
const {
|
|
220
|
+
const { shaderNode, inputNodes } = this;
|
|
201
221
|
|
|
202
|
-
|
|
222
|
+
const jsFunc = shaderNode.jsFunc;
|
|
223
|
+
const outputNode = inputNodes !== null ? jsFunc( nodeObjects( inputNodes ), builder.stack, builder ) : jsFunc( builder.stack, builder );
|
|
224
|
+
|
|
225
|
+
return nodeObject( outputNode );
|
|
203
226
|
|
|
204
227
|
}
|
|
205
228
|
|
|
206
|
-
|
|
229
|
+
setup( builder ) {
|
|
207
230
|
|
|
208
231
|
builder.addStack();
|
|
209
232
|
|
|
210
|
-
builder.stack.outputNode =
|
|
233
|
+
builder.stack.outputNode = this.call( builder );
|
|
211
234
|
|
|
212
235
|
return builder.removeStack();
|
|
213
236
|
|
|
214
237
|
}
|
|
215
238
|
|
|
239
|
+
generate( builder, output ) {
|
|
240
|
+
|
|
241
|
+
const { outputNode } = builder.getNodeProperties( this );
|
|
242
|
+
|
|
243
|
+
if ( outputNode === null ) {
|
|
244
|
+
|
|
245
|
+
// TSL: It's recommended to use `tslFn` in setup() pass.
|
|
246
|
+
|
|
247
|
+
return this.call( builder ).build( builder, output );
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return super.generate( builder, output );
|
|
252
|
+
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
class ShaderNodeInternal extends Node {
|
|
258
|
+
|
|
259
|
+
constructor( jsFunc ) {
|
|
260
|
+
|
|
261
|
+
super();
|
|
262
|
+
|
|
263
|
+
this.jsFunc = jsFunc;
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
call( inputs = null ) {
|
|
268
|
+
|
|
269
|
+
return nodeObject( new ShaderCallNodeInternal( this, inputs ) );
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
setup() {
|
|
274
|
+
|
|
275
|
+
return this.call();
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
216
279
|
}
|
|
217
280
|
|
|
218
281
|
const bools = [ false, true ];
|
|
@@ -330,19 +393,13 @@ export const shader = ( jsFunc ) => { // @deprecated, r154
|
|
|
330
393
|
|
|
331
394
|
export const tslFn = ( jsFunc ) => {
|
|
332
395
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return ( ...params ) => {
|
|
336
|
-
|
|
337
|
-
if ( shaderNode === null ) shaderNode = new ShaderNode( jsFunc );
|
|
338
|
-
|
|
339
|
-
return shaderNode.call( ...params );
|
|
396
|
+
const shaderNode = new ShaderNode( jsFunc );
|
|
340
397
|
|
|
341
|
-
|
|
398
|
+
return ( inputs ) => shaderNode.call( inputs );
|
|
342
399
|
|
|
343
400
|
};
|
|
344
401
|
|
|
345
|
-
addNodeClass( ShaderNode );
|
|
402
|
+
addNodeClass( 'ShaderNode', ShaderNode );
|
|
346
403
|
|
|
347
404
|
// types
|
|
348
405
|
// @TODO: Maybe export from ConstNode.js?
|
|
@@ -13,7 +13,7 @@ class EquirectUVNode extends TempNode {
|
|
|
13
13
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
setup() {
|
|
17
17
|
|
|
18
18
|
const dir = this.dirNode;
|
|
19
19
|
|
|
@@ -30,4 +30,4 @@ export default EquirectUVNode;
|
|
|
30
30
|
|
|
31
31
|
export const equirectUV = nodeProxy( EquirectUVNode );
|
|
32
32
|
|
|
33
|
-
addNodeClass( EquirectUVNode );
|
|
33
|
+
addNodeClass( 'EquirectUVNode', EquirectUVNode );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
2
|
import { expression } from '../code/ExpressionNode.js';
|
|
3
3
|
import { bypass } from '../core/BypassNode.js';
|
|
4
|
-
import { context
|
|
4
|
+
import { context } from '../core/ContextNode.js';
|
|
5
5
|
import { addNodeElement, nodeObject, nodeArray } from '../shadernode/ShaderNode.js';
|
|
6
6
|
|
|
7
7
|
class LoopNode extends Node {
|
|
@@ -53,9 +53,9 @@ class LoopNode extends Node {
|
|
|
53
53
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
setup( builder ) {
|
|
57
57
|
|
|
58
|
-
//
|
|
58
|
+
// setup properties
|
|
59
59
|
|
|
60
60
|
this.getProperties( builder );
|
|
61
61
|
|
|
@@ -65,13 +65,11 @@ class LoopNode extends Node {
|
|
|
65
65
|
|
|
66
66
|
const properties = this.getProperties( builder );
|
|
67
67
|
|
|
68
|
-
const
|
|
68
|
+
const contextData = { tempWrite: false };
|
|
69
69
|
|
|
70
70
|
const params = this.params;
|
|
71
71
|
const stackNode = properties.stackNode;
|
|
72
72
|
|
|
73
|
-
const returnsSnippet = properties.returnsNode ? properties.returnsNode.build( builder ) : '';
|
|
74
|
-
|
|
75
73
|
for ( let i = 0, l = params.length - 1; i < l; i ++ ) {
|
|
76
74
|
|
|
77
75
|
const param = params[ i ];
|
|
@@ -82,7 +80,7 @@ class LoopNode extends Node {
|
|
|
82
80
|
if ( param.isNode ) {
|
|
83
81
|
|
|
84
82
|
start = '0';
|
|
85
|
-
end = param.
|
|
83
|
+
end = param.build( builder, 'int' );
|
|
86
84
|
direction = 'forward';
|
|
87
85
|
|
|
88
86
|
} else {
|
|
@@ -92,10 +90,10 @@ class LoopNode extends Node {
|
|
|
92
90
|
direction = param.direction;
|
|
93
91
|
|
|
94
92
|
if ( typeof start === 'number' ) start = start.toString();
|
|
95
|
-
else if ( start && start.isNode ) start = start.
|
|
93
|
+
else if ( start && start.isNode ) start = start.build( builder, 'int' );
|
|
96
94
|
|
|
97
95
|
if ( typeof end === 'number' ) end = end.toString();
|
|
98
|
-
else if ( end && end.isNode ) end = end.
|
|
96
|
+
else if ( end && end.isNode ) end = end.build( builder, 'int' );
|
|
99
97
|
|
|
100
98
|
if ( start !== undefined && end === undefined ) {
|
|
101
99
|
|
|
@@ -159,7 +157,9 @@ class LoopNode extends Node {
|
|
|
159
157
|
|
|
160
158
|
}
|
|
161
159
|
|
|
162
|
-
const stackSnippet =
|
|
160
|
+
const stackSnippet = context( stackNode, contextData ).build( builder, 'void' );
|
|
161
|
+
|
|
162
|
+
const returnsSnippet = properties.returnsNode ? properties.returnsNode.build( builder ) : '';
|
|
163
163
|
|
|
164
164
|
builder.removeFlowTab().addFlowCode( '\n' + builder.tab + stackSnippet );
|
|
165
165
|
|
|
@@ -183,4 +183,4 @@ export const loop = ( ...params ) => nodeObject( new LoopNode( nodeArray( params
|
|
|
183
183
|
|
|
184
184
|
addNodeElement( 'loop', ( returns, ...params ) => bypass( returns, loop( ...params ) ) );
|
|
185
185
|
|
|
186
|
-
addNodeClass( LoopNode );
|
|
186
|
+
addNodeClass( 'LoopNode', LoopNode );
|
|
@@ -12,7 +12,7 @@ class MatcapUVNode extends TempNode {
|
|
|
12
12
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
setup() {
|
|
16
16
|
|
|
17
17
|
const x = vec3( positionViewDirection.z, 0, positionViewDirection.x.negate() ).normalize();
|
|
18
18
|
const y = positionViewDirection.cross( x );
|
|
@@ -27,4 +27,4 @@ export default MatcapUVNode;
|
|
|
27
27
|
|
|
28
28
|
export const matcapUV = nodeImmutable( MatcapUVNode );
|
|
29
29
|
|
|
30
|
-
addNodeClass( MatcapUVNode );
|
|
30
|
+
addNodeClass( 'MatcapUVNode', MatcapUVNode );
|
|
@@ -19,7 +19,7 @@ class OscNode extends Node {
|
|
|
19
19
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
setup() {
|
|
23
23
|
|
|
24
24
|
const method = this.method;
|
|
25
25
|
const timeNode = nodeObject( this.timeNode );
|
|
@@ -78,4 +78,4 @@ export const oscSquare = nodeProxy( OscNode, OscNode.SQUARE );
|
|
|
78
78
|
export const oscTriangle = nodeProxy( OscNode, OscNode.TRIANGLE );
|
|
79
79
|
export const oscSawtooth = nodeProxy( OscNode, OscNode.SAWTOOTH );
|
|
80
80
|
|
|
81
|
-
addNodeClass( OscNode );
|
|
81
|
+
addNodeClass( 'OscNode', OscNode );
|
|
@@ -19,7 +19,7 @@ class PackingNode extends TempNode {
|
|
|
19
19
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
setup() {
|
|
23
23
|
|
|
24
24
|
const { scope, node } = this;
|
|
25
25
|
|
|
@@ -52,4 +52,4 @@ export const colorToDirection = nodeProxy( PackingNode, PackingNode.COLOR_TO_DIR
|
|
|
52
52
|
addNodeElement( 'directionToColor', directionToColor );
|
|
53
53
|
addNodeElement( 'colorToDirection', colorToDirection );
|
|
54
54
|
|
|
55
|
-
addNodeClass( PackingNode );
|
|
55
|
+
addNodeClass( 'PackingNode', PackingNode );
|