super-three 0.168.0 → 0.169.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 +369 -131
- package/build/three.module.js +369 -131
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +24644 -22406
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +79941 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/jsm/Addons.js +0 -6
- package/examples/jsm/controls/TrackballControls.js +32 -12
- package/examples/jsm/controls/TransformControls.js +97 -62
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/KTX2Exporter.js +21 -13
- package/examples/jsm/exporters/OBJExporter.js +5 -1
- package/examples/jsm/exporters/PLYExporter.js +9 -7
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelperGPU.js +65 -0
- package/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/LightProbeGenerator.js +24 -10
- package/examples/jsm/loaders/ColladaLoader.js +9 -6
- package/examples/jsm/loaders/DRACOLoader.js +3 -1
- package/examples/jsm/loaders/FBXLoader.js +30 -20
- package/examples/jsm/loaders/GLTFLoader.js +5 -10
- package/examples/jsm/loaders/KTX2Loader.js +10 -7
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +29 -10
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +5 -4
- package/examples/jsm/loaders/PDBLoader.js +3 -2
- package/examples/jsm/loaders/PLYLoader.js +8 -5
- package/examples/jsm/loaders/STLLoader.js +3 -2
- package/examples/jsm/loaders/VRMLLoader.js +10 -10
- package/examples/jsm/loaders/VTKLoader.js +4 -3
- package/examples/jsm/loaders/XYZLoader.js +3 -2
- package/examples/jsm/misc/Timer.js +1 -1
- package/examples/jsm/modifiers/CurveModifierGPU.js +233 -0
- package/examples/jsm/objects/LensflareMesh.js +322 -0
- package/examples/jsm/objects/SkyMesh.js +1 -2
- package/examples/jsm/objects/Water2Mesh.js +2 -3
- package/examples/jsm/objects/WaterMesh.js +1 -2
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/physics/RapierPhysics.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/utils/GeometryCompressionUtils.js +37 -122
- package/examples/jsm/utils/ShadowMapViewer.js +3 -8
- package/examples/jsm/utils/ShadowMapViewerGPU.js +201 -0
- package/examples/jsm/utils/SkeletonUtils.js +84 -66
- package/examples/jsm/utils/TextureUtils.js +1 -0
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/package.json +2 -2
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +2 -1
- package/src/audio/Audio.js +2 -2
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +0 -9
- package/src/core/Clock.js +1 -1
- package/src/core/InterleavedBuffer.js +0 -9
- package/src/extras/Controls.js +1 -1
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/loaders/MaterialLoader.js +7 -1
- package/src/loaders/nodes/NodeLoader.js +24 -4
- package/src/loaders/nodes/NodeMaterialLoader.js +21 -17
- package/src/loaders/nodes/NodeObjectLoader.js +19 -0
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +19 -34
- package/src/materials/nodes/Line2NodeMaterial.js +26 -26
- package/src/materials/nodes/LineBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/LineDashedNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshLambertNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshNormalNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhongNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshSSSNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshStandardNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshToonNodeMaterial.js +7 -3
- package/src/materials/nodes/NodeMaterial.js +20 -45
- package/src/materials/nodes/NodeMaterials.js +2 -0
- package/src/materials/nodes/PointsNodeMaterial.js +7 -3
- package/src/materials/nodes/ShadowNodeMaterial.js +7 -3
- package/src/materials/nodes/SpriteNodeMaterial.js +39 -6
- package/src/materials/nodes/VolumeNodeMaterial.js +13 -9
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- package/src/math/Triangle.js +24 -0
- package/src/nodes/Nodes.js +3 -3
- package/src/nodes/TSL.js +96 -93
- package/src/nodes/accessors/BatchNode.js +7 -3
- package/src/nodes/accessors/BufferAttributeNode.js +6 -3
- package/src/nodes/accessors/BufferNode.js +6 -3
- package/src/nodes/accessors/Camera.js +10 -16
- package/src/nodes/accessors/ClippingNode.js +7 -3
- package/src/nodes/accessors/CubeTextureNode.js +6 -3
- package/src/nodes/accessors/InstanceNode.js +11 -11
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +6 -3
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +8 -4
- package/src/nodes/accessors/MaterialReferenceNode.js +6 -3
- package/src/nodes/accessors/ModelNode.js +42 -7
- package/src/nodes/accessors/ModelViewProjectionNode.js +9 -5
- package/src/nodes/accessors/MorphNode.js +7 -3
- package/src/nodes/accessors/Normal.js +32 -6
- package/src/nodes/accessors/Object3DNode.js +11 -27
- package/src/nodes/accessors/PointUVNode.js +7 -3
- package/src/nodes/accessors/ReferenceBaseNode.js +32 -4
- package/src/nodes/accessors/ReferenceNode.js +40 -3
- package/src/nodes/accessors/RendererReferenceNode.js +9 -3
- package/src/nodes/accessors/SceneNode.js +7 -3
- package/src/nodes/accessors/SkinningNode.js +7 -3
- package/src/nodes/accessors/StorageBufferNode.js +21 -3
- package/src/nodes/accessors/StorageTextureNode.js +7 -4
- package/src/nodes/accessors/Texture3DNode.js +7 -4
- package/src/nodes/accessors/TextureNode.js +19 -8
- package/src/nodes/accessors/TextureSizeNode.js +8 -5
- package/src/nodes/accessors/UniformArrayNode.js +12 -9
- package/src/nodes/accessors/UserDataNode.js +9 -6
- package/src/nodes/accessors/VelocityNode.js +74 -23
- package/src/nodes/accessors/VertexColorNode.js +6 -3
- package/src/nodes/code/CodeNode.js +7 -3
- package/src/nodes/code/ExpressionNode.js +8 -4
- package/src/nodes/code/FunctionCallNode.js +6 -3
- package/src/nodes/code/FunctionNode.js +6 -3
- package/src/nodes/code/ScriptableNode.js +11 -6
- package/src/nodes/code/ScriptableValueNode.js +7 -3
- package/src/nodes/core/AssignNode.js +9 -6
- package/src/nodes/core/AttributeNode.js +7 -3
- package/src/nodes/core/BypassNode.js +8 -4
- package/src/nodes/core/CacheNode.js +8 -4
- package/src/nodes/core/ConstNode.js +6 -3
- package/src/nodes/core/ContextNode.js +7 -3
- package/src/nodes/core/IndexNode.js +25 -3
- package/src/nodes/core/InputNode.js +7 -3
- package/src/nodes/core/MRTNode.js +6 -3
- package/src/nodes/core/Node.js +10 -51
- package/src/nodes/core/NodeBuilder.js +71 -5
- package/src/nodes/core/NodeUtils.js +48 -6
- package/src/nodes/core/OutputStructNode.js +8 -4
- package/src/nodes/core/ParameterNode.js +6 -3
- package/src/nodes/core/PropertyNode.js +7 -3
- package/src/nodes/core/StackNode.js +7 -3
- package/src/nodes/core/StructTypeNode.js +7 -3
- package/src/nodes/core/TempNode.js +8 -4
- package/src/nodes/core/UniformGroupNode.js +10 -6
- package/src/nodes/core/UniformNode.js +6 -3
- package/src/nodes/core/VarNode.js +8 -4
- package/src/nodes/core/VaryingNode.js +7 -3
- package/src/nodes/display/AfterImageNode.js +6 -0
- package/src/nodes/display/AnaglyphPassNode.js +6 -0
- package/src/nodes/display/AnamorphicNode.js +6 -0
- package/src/nodes/display/BloomNode.js +6 -0
- package/src/nodes/display/BumpMapNode.js +6 -0
- package/src/nodes/display/ColorSpaceFunctions.js +4 -4
- package/src/nodes/display/ColorSpaceNode.js +43 -14
- package/src/nodes/display/DenoiseNode.js +6 -3
- package/src/nodes/display/DepthOfFieldNode.js +6 -3
- package/src/nodes/display/DotScreenNode.js +8 -5
- package/src/nodes/display/FXAANode.js +6 -3
- package/src/nodes/display/FilmNode.js +6 -3
- package/src/nodes/display/FrontFacingNode.js +7 -3
- package/src/nodes/display/GTAONode.js +6 -3
- package/src/nodes/display/GaussianBlurNode.js +6 -3
- package/src/nodes/display/Lut3DNode.js +6 -3
- package/src/nodes/display/NormalMapNode.js +8 -6
- package/src/nodes/display/ParallaxBarrierPassNode.js +8 -5
- package/src/nodes/display/PassNode.js +18 -7
- package/src/nodes/display/PixelationPassNode.js +12 -5
- package/src/nodes/display/PosterizeNode.js +6 -3
- package/src/nodes/display/RGBShiftNode.js +6 -3
- package/src/nodes/display/RenderOutputNode.js +12 -8
- package/src/nodes/display/SSAAPassNode.js +6 -3
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/SobelOperatorNode.js +6 -3
- package/src/nodes/display/StereoCompositePassNode.js +6 -3
- package/src/nodes/display/StereoPassNode.js +6 -3
- package/src/nodes/display/ToneMappingFunctions.js +12 -12
- package/src/nodes/display/ToneMappingNode.js +8 -7
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +6 -3
- package/src/nodes/display/ViewportDepthNode.js +7 -3
- package/src/nodes/display/ViewportDepthTextureNode.js +8 -5
- package/src/nodes/display/ViewportSharedTextureNode.js +8 -5
- package/src/nodes/display/ViewportTextureNode.js +8 -5
- package/src/nodes/fog/FogExp2Node.js +6 -3
- package/src/nodes/fog/FogNode.js +7 -3
- package/src/nodes/fog/FogRangeNode.js +6 -3
- package/src/nodes/functions/PhysicalLightingModel.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +7 -3
- package/src/nodes/gpgpu/AtomicFunctionNode.js +99 -0
- package/src/nodes/gpgpu/BarrierNode.js +40 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +98 -0
- package/src/nodes/gpgpu/ComputeNode.js +8 -4
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +6 -3
- package/src/nodes/lighting/AmbientLightNode.js +6 -3
- package/src/nodes/lighting/AnalyticLightNode.js +198 -30
- package/src/nodes/lighting/BasicEnvironmentNode.js +6 -3
- package/src/nodes/lighting/BasicLightMapNode.js +6 -3
- package/src/nodes/lighting/DirectionalLightNode.js +7 -4
- package/src/nodes/lighting/EnvironmentNode.js +6 -3
- package/src/nodes/lighting/HemisphereLightNode.js +10 -6
- package/src/nodes/lighting/IESSpotLightNode.js +6 -3
- package/src/nodes/lighting/IrradianceNode.js +6 -3
- package/src/nodes/lighting/LightProbeNode.js +8 -31
- package/src/nodes/lighting/LightingContextNode.js +6 -3
- package/src/nodes/lighting/LightingNode.js +7 -3
- package/src/nodes/lighting/LightsNode.js +24 -5
- package/src/nodes/lighting/PointLightNode.js +11 -7
- package/src/nodes/lighting/RectAreaLightNode.js +11 -7
- package/src/nodes/lighting/SpotLightNode.js +13 -10
- package/src/nodes/math/ConditionalNode.js +23 -6
- package/src/nodes/math/MathNode.js +6 -3
- package/src/nodes/math/OperatorNode.js +6 -3
- package/src/nodes/pmrem/PMREMNode.js +6 -3
- package/src/nodes/utils/ArrayElementNode.js +8 -4
- package/src/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +6 -3
- package/src/nodes/utils/EquirectUVNode.js +6 -3
- package/src/nodes/utils/FlipNode.js +7 -4
- package/src/nodes/utils/FunctionOverloadingNode.js +7 -3
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +7 -3
- package/src/nodes/utils/MatcapUVNode.js +6 -3
- package/src/nodes/utils/MaxMipLevelNode.js +6 -3
- package/src/nodes/utils/OscNode.js +7 -3
- package/src/nodes/utils/RTTNode.js +6 -3
- package/src/nodes/utils/ReflectorNode.js +8 -5
- package/src/nodes/utils/RemapNode.js +7 -3
- package/src/nodes/utils/RotateNode.js +6 -3
- package/src/nodes/utils/SetNode.js +7 -4
- package/src/nodes/utils/SplitNode.js +7 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +7 -3
- package/src/nodes/utils/StorageArrayElementNode.js +9 -8
- package/src/nodes/utils/TimerNode.js +6 -3
- package/src/nodes/utils/TriplanarTexturesNode.js +7 -3
- package/src/nodes/utils/ViewportUtils.js +2 -2
- package/src/objects/BatchedMesh.js +76 -10
- package/src/objects/LOD.js +21 -0
- package/src/objects/Line.js +1 -0
- package/src/objects/Mesh.js +7 -23
- package/src/objects/Points.js +2 -0
- package/src/renderers/WebGLRenderer.js +64 -41
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ClippingContext.js +4 -3
- package/src/renderers/common/RenderContext.js +4 -5
- package/src/renderers/common/RenderObject.js +116 -5
- package/src/renderers/common/RenderObjects.js +8 -1
- package/src/renderers/common/Renderer.js +57 -49
- package/src/renderers/common/extras/PMREMGenerator.js +7 -9
- package/src/renderers/common/nodes/NodeBuilderState.js +3 -3
- package/src/renderers/common/nodes/Nodes.js +33 -14
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/src/renderers/webgl/WebGLAttributes.js +45 -14
- package/src/renderers/webgl/WebGLCapabilities.js +9 -0
- package/src/renderers/webgl/WebGLProgram.js +2 -0
- package/src/renderers/webgl/WebGLPrograms.js +21 -17
- package/src/renderers/webgl/WebGLState.js +21 -0
- package/src/renderers/webgl/WebGLTextures.js +22 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +50 -45
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +4 -4
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +6 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +1 -4
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +61 -16
- package/src/renderers/webgpu/WebGPUBackend.js +33 -25
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/src/renderers/webgpu/WebGPURenderer.js +5 -2
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/{common → webgpu}/nodes/StandardNodeLibrary.js +11 -11
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +91 -11
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -16
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +7 -5
- package/src/renderers/webgpu/utils/WebGPUUtils.js +1 -1
- package/src/utils.js +33 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/utils/GPUStatsPanel.js +0 -95
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/src/nodes/display/ViewportNode.js +0 -138
- package/src/nodes/lighting/LightNode.js +0 -57
- package/src/renderers/common/StandardRenderer.js +0 -18
package/src/core/Clock.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as MathUtils from '../math/MathUtils.js';
|
|
2
2
|
import { StaticDrawUsage } from '../constants.js';
|
|
3
|
-
import { warnOnce } from '../utils.js';
|
|
4
3
|
|
|
5
4
|
class InterleavedBuffer {
|
|
6
5
|
|
|
@@ -13,7 +12,6 @@ class InterleavedBuffer {
|
|
|
13
12
|
this.count = array !== undefined ? array.length / stride : 0;
|
|
14
13
|
|
|
15
14
|
this.usage = StaticDrawUsage;
|
|
16
|
-
this._updateRange = { offset: 0, count: - 1 };
|
|
17
15
|
this.updateRanges = [];
|
|
18
16
|
|
|
19
17
|
this.version = 0;
|
|
@@ -30,13 +28,6 @@ class InterleavedBuffer {
|
|
|
30
28
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
get updateRange() {
|
|
34
|
-
|
|
35
|
-
warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
|
|
36
|
-
return this._updateRange;
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
31
|
setUsage( value ) {
|
|
41
32
|
|
|
42
33
|
this.usage = value;
|
package/src/extras/Controls.js
CHANGED
|
@@ -133,12 +133,19 @@ class CylinderGeometry extends BufferGeometry {
|
|
|
133
133
|
|
|
134
134
|
// faces
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
indices.push( b, c, d );
|
|
136
|
+
if ( radiusTop > 0 ) {
|
|
138
137
|
|
|
139
|
-
|
|
138
|
+
indices.push( a, b, d );
|
|
139
|
+
groupCount += 3;
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if ( radiusBottom > 0 ) {
|
|
144
|
+
|
|
145
|
+
indices.push( b, c, d );
|
|
146
|
+
groupCount += 3;
|
|
147
|
+
|
|
148
|
+
}
|
|
142
149
|
|
|
143
150
|
}
|
|
144
151
|
|
|
@@ -86,7 +86,7 @@ class MaterialLoader extends Loader {
|
|
|
86
86
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const material =
|
|
89
|
+
const material = this.createMaterialFromType( json.type );
|
|
90
90
|
|
|
91
91
|
if ( json.uuid !== undefined ) material.uuid = json.uuid;
|
|
92
92
|
if ( json.name !== undefined ) material.name = json.name;
|
|
@@ -342,6 +342,12 @@ class MaterialLoader extends Loader {
|
|
|
342
342
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
createMaterialFromType( type ) {
|
|
346
|
+
|
|
347
|
+
return MaterialLoader.createMaterialFromType( type );
|
|
348
|
+
|
|
349
|
+
}
|
|
350
|
+
|
|
345
351
|
static createMaterialFromType( type ) {
|
|
346
352
|
|
|
347
353
|
const materialLib = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nodeObject } from '../../nodes/tsl/TSLBase.js';
|
|
1
|
+
import { nodeObject, float } from '../../nodes/tsl/TSLBase.js';
|
|
3
2
|
|
|
4
3
|
import { Loader } from '../Loader.js';
|
|
5
4
|
import { FileLoader } from '../../loaders/FileLoader.js';
|
|
@@ -11,6 +10,7 @@ class NodeLoader extends Loader {
|
|
|
11
10
|
super( manager );
|
|
12
11
|
|
|
13
12
|
this.textures = {};
|
|
13
|
+
this.nodes = {};
|
|
14
14
|
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ class NodeLoader extends Loader {
|
|
|
56
56
|
|
|
57
57
|
const { uuid, type } = nodeJSON;
|
|
58
58
|
|
|
59
|
-
nodes[ uuid ] =
|
|
59
|
+
nodes[ uuid ] = this.createNodeFromType( type );
|
|
60
60
|
nodes[ uuid ].uuid = uuid;
|
|
61
61
|
|
|
62
62
|
}
|
|
@@ -82,7 +82,7 @@ class NodeLoader extends Loader {
|
|
|
82
82
|
|
|
83
83
|
parse( json ) {
|
|
84
84
|
|
|
85
|
-
const node =
|
|
85
|
+
const node = this.createNodeFromType( json.type );
|
|
86
86
|
node.uuid = json.uuid;
|
|
87
87
|
|
|
88
88
|
const nodes = this.parseNodes( json.nodes );
|
|
@@ -105,6 +105,26 @@ class NodeLoader extends Loader {
|
|
|
105
105
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
setNodes( value ) {
|
|
109
|
+
|
|
110
|
+
this.nodes = value;
|
|
111
|
+
return this;
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
createNodeFromType( type ) {
|
|
116
|
+
|
|
117
|
+
if ( this.nodes[ type ] === undefined ) {
|
|
118
|
+
|
|
119
|
+
console.error( 'THREE.NodeLoader: Node type not found:', type );
|
|
120
|
+
return float();
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return nodeObject( new this.nodes[ type ]() );
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
108
128
|
}
|
|
109
129
|
|
|
110
130
|
export default NodeLoader;
|
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { MaterialLoader } from '../../loaders/MaterialLoader.js';
|
|
2
|
-
import { createNodeMaterialFromType } from '../../materials/nodes/NodeMaterial.js';
|
|
3
|
-
|
|
4
|
-
const superFromTypeFunction = MaterialLoader.createMaterialFromType;
|
|
5
|
-
|
|
6
|
-
MaterialLoader.createMaterialFromType = function ( type ) {
|
|
7
|
-
|
|
8
|
-
const material = createNodeMaterialFromType( type );
|
|
9
|
-
|
|
10
|
-
if ( material !== undefined ) {
|
|
11
|
-
|
|
12
|
-
return material;
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return superFromTypeFunction.call( this, type );
|
|
17
|
-
|
|
18
|
-
};
|
|
19
2
|
|
|
20
3
|
class NodeMaterialLoader extends MaterialLoader {
|
|
21
4
|
|
|
@@ -24,6 +7,7 @@ class NodeMaterialLoader extends MaterialLoader {
|
|
|
24
7
|
super( manager );
|
|
25
8
|
|
|
26
9
|
this.nodes = {};
|
|
10
|
+
this.nodeMaterials = {};
|
|
27
11
|
|
|
28
12
|
}
|
|
29
13
|
|
|
@@ -49,11 +33,31 @@ class NodeMaterialLoader extends MaterialLoader {
|
|
|
49
33
|
setNodes( value ) {
|
|
50
34
|
|
|
51
35
|
this.nodes = value;
|
|
36
|
+
return this;
|
|
52
37
|
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
setNodeMaterials( value ) {
|
|
41
|
+
|
|
42
|
+
this.nodeMaterials = value;
|
|
53
43
|
return this;
|
|
54
44
|
|
|
55
45
|
}
|
|
56
46
|
|
|
47
|
+
createMaterialFromType( type ) {
|
|
48
|
+
|
|
49
|
+
const materialClass = this.nodeMaterials[ type ];
|
|
50
|
+
|
|
51
|
+
if ( materialClass !== undefined ) {
|
|
52
|
+
|
|
53
|
+
return new materialClass();
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return super.createMaterialFromType( type );
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export default NodeMaterialLoader;
|
|
@@ -9,10 +9,27 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
9
9
|
|
|
10
10
|
super( manager );
|
|
11
11
|
|
|
12
|
+
this.nodes = {};
|
|
13
|
+
this.nodeMaterials = {};
|
|
14
|
+
|
|
12
15
|
this._nodesJSON = null;
|
|
13
16
|
|
|
14
17
|
}
|
|
15
18
|
|
|
19
|
+
setNodes( value ) {
|
|
20
|
+
|
|
21
|
+
this.nodes = value;
|
|
22
|
+
return this;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setNodeMaterials( value ) {
|
|
27
|
+
|
|
28
|
+
this.nodeMaterials = value;
|
|
29
|
+
return this;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
parse( json, onLoad ) {
|
|
17
34
|
|
|
18
35
|
this._nodesJSON = json.nodes;
|
|
@@ -30,6 +47,7 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
30
47
|
if ( json !== undefined ) {
|
|
31
48
|
|
|
32
49
|
const loader = new NodeLoader();
|
|
50
|
+
loader.setNodes( this.nodes );
|
|
33
51
|
loader.setTextures( textures );
|
|
34
52
|
|
|
35
53
|
return loader.parseNodes( json );
|
|
@@ -51,6 +69,7 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
51
69
|
const loader = new NodeMaterialLoader();
|
|
52
70
|
loader.setTextures( textures );
|
|
53
71
|
loader.setNodes( nodes );
|
|
72
|
+
loader.setNodeMaterials( this.nodeMaterials );
|
|
54
73
|
|
|
55
74
|
for ( let i = 0, l = json.length; i < l; i ++ ) {
|
|
56
75
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import NodeMaterial
|
|
2
|
-
import { property } from '../../nodes/core/PropertyNode.js';
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
3
2
|
import { attribute } from '../../nodes/core/AttributeNode.js';
|
|
4
3
|
import { cameraProjectionMatrix } from '../../nodes/accessors/Camera.js';
|
|
5
4
|
import { materialColor, materialOpacity, materialPointWidth } from '../../nodes/accessors/MaterialNode.js'; // or should this be a property, instead?
|
|
6
5
|
import { modelViewMatrix } from '../../nodes/accessors/ModelNode.js';
|
|
7
6
|
import { positionGeometry } from '../../nodes/accessors/Position.js';
|
|
8
|
-
import { smoothstep } from '../../nodes/math/MathNode.js';
|
|
9
|
-
import { Fn,
|
|
7
|
+
import { smoothstep, lengthSq } from '../../nodes/math/MathNode.js';
|
|
8
|
+
import { Fn, vec4, float } from '../../nodes/tsl/TSLBase.js';
|
|
10
9
|
import { uv } from '../../nodes/accessors/UV.js';
|
|
11
|
-
import { viewport } from '../../nodes/display/
|
|
10
|
+
import { viewport } from '../../nodes/display/ScreenNode.js';
|
|
12
11
|
|
|
13
12
|
import { PointsMaterial } from '../PointsMaterial.js';
|
|
14
13
|
|
|
@@ -16,6 +15,12 @@ const _defaultValues = /*@__PURE__*/ new PointsMaterial();
|
|
|
16
15
|
|
|
17
16
|
class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
18
17
|
|
|
18
|
+
static get type() {
|
|
19
|
+
|
|
20
|
+
return 'InstancedPointsNodeMaterial';
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
constructor( params = {} ) {
|
|
20
25
|
|
|
21
26
|
super();
|
|
@@ -34,35 +39,29 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
34
39
|
|
|
35
40
|
this.setDefaultValues( _defaultValues );
|
|
36
41
|
|
|
37
|
-
this.setupShaders();
|
|
38
|
-
|
|
39
42
|
this.setValues( params );
|
|
40
43
|
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
setup( builder ) {
|
|
44
47
|
|
|
45
|
-
this.setupShaders();
|
|
48
|
+
this.setupShaders( builder );
|
|
46
49
|
|
|
47
50
|
super.setup( builder );
|
|
48
51
|
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
setupShaders() {
|
|
54
|
+
setupShaders( { renderer } ) {
|
|
52
55
|
|
|
53
56
|
const useAlphaToCoverage = this.alphaToCoverage;
|
|
54
57
|
const useColor = this.useColor;
|
|
55
58
|
|
|
56
59
|
this.vertexNode = Fn( () => {
|
|
57
60
|
|
|
58
|
-
//vUv = uv;
|
|
59
|
-
varying( vec2(), 'vUv' ).assign( uv() ); // @TODO: Analyze other way to do this
|
|
60
|
-
|
|
61
61
|
const instancePosition = attribute( 'instancePosition' ).xyz;
|
|
62
62
|
|
|
63
63
|
// camera space
|
|
64
|
-
const mvPos =
|
|
65
|
-
mvPos.assign( modelViewMatrix.mul( vec4( instancePosition, 1.0 ) ) );
|
|
64
|
+
const mvPos = vec4( modelViewMatrix.mul( vec4( instancePosition, 1.0 ) ) );
|
|
66
65
|
|
|
67
66
|
const aspect = viewport.z.div( viewport.w );
|
|
68
67
|
|
|
@@ -70,8 +69,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
70
69
|
const clipPos = cameraProjectionMatrix.mul( mvPos );
|
|
71
70
|
|
|
72
71
|
// offset in ndc space
|
|
73
|
-
const offset =
|
|
74
|
-
offset.assign( positionGeometry.xy );
|
|
72
|
+
const offset = positionGeometry.xy.toVar();
|
|
75
73
|
|
|
76
74
|
offset.mulAssign( this.pointWidthNode ? this.pointWidthNode : materialPointWidth );
|
|
77
75
|
|
|
@@ -82,32 +80,21 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
82
80
|
offset.assign( offset.mul( clipPos.w ) );
|
|
83
81
|
|
|
84
82
|
//clipPos.xy += offset;
|
|
85
|
-
clipPos.
|
|
83
|
+
clipPos.addAssign( vec4( offset, 0, 0 ) );
|
|
86
84
|
|
|
87
85
|
return clipPos;
|
|
88
86
|
|
|
89
|
-
//vec4 mvPosition = mvPos; // this was used for somethihng...
|
|
90
|
-
|
|
91
87
|
} )();
|
|
92
88
|
|
|
93
89
|
this.fragmentNode = Fn( () => {
|
|
94
90
|
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
// force assignment into correct place in flow
|
|
98
|
-
const alpha = property( 'float', 'alpha' );
|
|
99
|
-
alpha.assign( 1 );
|
|
91
|
+
const alpha = float( 1 ).toVar();
|
|
100
92
|
|
|
101
|
-
const
|
|
102
|
-
const b = vUv.y;
|
|
93
|
+
const len2 = lengthSq( uv().mul( 2 ).sub( 1 ) );
|
|
103
94
|
|
|
104
|
-
|
|
95
|
+
if ( useAlphaToCoverage && renderer.samples > 1 ) {
|
|
105
96
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// force assignment out of following 'if' statement - to avoid uniform control flow errors
|
|
109
|
-
const dlen = property( 'float', 'dlen' );
|
|
110
|
-
dlen.assign( len2.fwidth() );
|
|
97
|
+
const dlen = float( len2.fwidth() ).toVar();
|
|
111
98
|
|
|
112
99
|
alpha.assign( smoothstep( dlen.oneMinus(), dlen.add( 1 ), len2 ).oneMinus() );
|
|
113
100
|
|
|
@@ -167,5 +154,3 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
167
154
|
}
|
|
168
155
|
|
|
169
156
|
export default InstancedPointsNodeMaterial;
|
|
170
|
-
|
|
171
|
-
InstancedPointsNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'InstancedPoints', InstancedPointsNodeMaterial );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import NodeMaterial
|
|
2
|
-
import {
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
|
+
import { varyingProperty } from '../../nodes/core/PropertyNode.js';
|
|
3
3
|
import { attribute } from '../../nodes/core/AttributeNode.js';
|
|
4
4
|
import { cameraProjectionMatrix } from '../../nodes/accessors/Camera.js';
|
|
5
5
|
import { materialColor, materialLineScale, materialLineDashSize, materialLineGapSize, materialLineDashOffset, materialLineWidth } from '../../nodes/accessors/MaterialNode.js';
|
|
@@ -8,7 +8,7 @@ import { positionGeometry } from '../../nodes/accessors/Position.js';
|
|
|
8
8
|
import { mix, smoothstep } from '../../nodes/math/MathNode.js';
|
|
9
9
|
import { Fn, varying, float, vec2, vec3, vec4, If } from '../../nodes/tsl/TSLBase.js';
|
|
10
10
|
import { uv } from '../../nodes/accessors/UV.js';
|
|
11
|
-
import { viewport } from '../../nodes/display/
|
|
11
|
+
import { viewport } from '../../nodes/display/ScreenNode.js';
|
|
12
12
|
import { dashSize, gapSize } from '../../nodes/core/PropertyNode.js';
|
|
13
13
|
|
|
14
14
|
import { LineDashedMaterial } from '../LineDashedMaterial.js';
|
|
@@ -17,6 +17,12 @@ const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
|
|
|
17
17
|
|
|
18
18
|
class Line2NodeMaterial extends NodeMaterial {
|
|
19
19
|
|
|
20
|
+
static get type() {
|
|
21
|
+
|
|
22
|
+
return 'Line2NodeMaterial';
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
constructor( params = {} ) {
|
|
21
27
|
|
|
22
28
|
super();
|
|
@@ -46,13 +52,13 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
46
52
|
|
|
47
53
|
setup( builder ) {
|
|
48
54
|
|
|
49
|
-
this.setupShaders();
|
|
55
|
+
this.setupShaders( builder );
|
|
50
56
|
|
|
51
57
|
super.setup( builder );
|
|
52
58
|
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
setupShaders() {
|
|
61
|
+
setupShaders( { renderer } ) {
|
|
56
62
|
|
|
57
63
|
const useAlphaToCoverage = this.alphaToCoverage;
|
|
58
64
|
const useColor = this.useColor;
|
|
@@ -69,22 +75,24 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
69
75
|
|
|
70
76
|
return vec4( mix( start.xyz, end.xyz, alpha ), end.w );
|
|
71
77
|
|
|
78
|
+
} ).setLayout( {
|
|
79
|
+
name: 'trimSegment',
|
|
80
|
+
type: 'vec4',
|
|
81
|
+
inputs: [
|
|
82
|
+
{ name: 'start', type: 'vec4' },
|
|
83
|
+
{ name: 'end', type: 'vec4' }
|
|
84
|
+
]
|
|
72
85
|
} );
|
|
73
86
|
|
|
74
87
|
this.vertexNode = Fn( () => {
|
|
75
88
|
|
|
76
|
-
varyingProperty( 'vec2', 'vUv' ).assign( uv() );
|
|
77
|
-
|
|
78
89
|
const instanceStart = attribute( 'instanceStart' );
|
|
79
90
|
const instanceEnd = attribute( 'instanceEnd' );
|
|
80
91
|
|
|
81
92
|
// camera space
|
|
82
93
|
|
|
83
|
-
const start =
|
|
84
|
-
const end =
|
|
85
|
-
|
|
86
|
-
start.assign( modelViewMatrix.mul( vec4( instanceStart, 1.0 ) ) ); // force assignment into correct place in flow
|
|
87
|
-
end.assign( modelViewMatrix.mul( vec4( instanceEnd, 1.0 ) ) );
|
|
94
|
+
const start = vec4( modelViewMatrix.mul( vec4( instanceStart, 1.0 ) ) ).toVar( 'start' );
|
|
95
|
+
const end = vec4( modelViewMatrix.mul( vec4( instanceEnd, 1.0 ) ) ).toVar( 'end' );
|
|
88
96
|
|
|
89
97
|
if ( useWorldUnits ) {
|
|
90
98
|
|
|
@@ -181,9 +189,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
181
189
|
|
|
182
190
|
} else {
|
|
183
191
|
|
|
184
|
-
const offset =
|
|
185
|
-
|
|
186
|
-
offset.assign( vec2( dir.y, dir.x.negate() ) );
|
|
192
|
+
const offset = vec2( dir.y, dir.x.negate() ).toVar( 'offset' );
|
|
187
193
|
|
|
188
194
|
// undo aspect ratio adjustment
|
|
189
195
|
dir.x.assign( dir.x.div( aspect ) );
|
|
@@ -248,7 +254,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
248
254
|
|
|
249
255
|
this.fragmentNode = Fn( () => {
|
|
250
256
|
|
|
251
|
-
const vUv =
|
|
257
|
+
const vUv = uv();
|
|
252
258
|
|
|
253
259
|
if ( useDash ) {
|
|
254
260
|
|
|
@@ -273,9 +279,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
273
279
|
|
|
274
280
|
}
|
|
275
281
|
|
|
276
|
-
|
|
277
|
-
const alpha = property( 'float', 'alpha' );
|
|
278
|
-
alpha.assign( 1 );
|
|
282
|
+
const alpha = float( 1 ).toVar( 'alpha' );
|
|
279
283
|
|
|
280
284
|
if ( useWorldUnits ) {
|
|
281
285
|
|
|
@@ -295,7 +299,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
295
299
|
|
|
296
300
|
if ( ! useDash ) {
|
|
297
301
|
|
|
298
|
-
if ( useAlphaToCoverage ) {
|
|
302
|
+
if ( useAlphaToCoverage && renderer.samples > 1 ) {
|
|
299
303
|
|
|
300
304
|
const dnorm = norm.fwidth();
|
|
301
305
|
alpha.assign( smoothstep( dnorm.negate().add( 0.5 ), dnorm.add( 0.5 ), norm ).oneMinus() );
|
|
@@ -312,16 +316,14 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
312
316
|
|
|
313
317
|
// round endcaps
|
|
314
318
|
|
|
315
|
-
if ( useAlphaToCoverage ) {
|
|
319
|
+
if ( useAlphaToCoverage && renderer.samples > 1 ) {
|
|
316
320
|
|
|
317
321
|
const a = vUv.x;
|
|
318
322
|
const b = vUv.y.greaterThan( 0.0 ).select( vUv.y.sub( 1.0 ), vUv.y.add( 1.0 ) );
|
|
319
323
|
|
|
320
324
|
const len2 = a.mul( a ).add( b.mul( b ) );
|
|
321
325
|
|
|
322
|
-
|
|
323
|
-
const dlen = property( 'float', 'dlen' );
|
|
324
|
-
dlen.assign( len2.fwidth() );
|
|
326
|
+
const dlen = float( len2.fwidth() ).toVar( 'dlen' );
|
|
325
327
|
|
|
326
328
|
If( vUv.y.abs().greaterThan( 1.0 ), () => {
|
|
327
329
|
|
|
@@ -433,5 +435,3 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
433
435
|
}
|
|
434
436
|
|
|
435
437
|
export default Line2NodeMaterial;
|
|
436
|
-
|
|
437
|
-
Line2NodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'Line2', Line2NodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
|
|
3
3
|
import { LineBasicMaterial } from '../LineBasicMaterial.js';
|
|
4
4
|
|
|
@@ -6,6 +6,12 @@ const _defaultValues = /*@__PURE__*/ new LineBasicMaterial();
|
|
|
6
6
|
|
|
7
7
|
class LineBasicNodeMaterial extends NodeMaterial {
|
|
8
8
|
|
|
9
|
+
static get type() {
|
|
10
|
+
|
|
11
|
+
return 'LineBasicNodeMaterial';
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
constructor( parameters ) {
|
|
10
16
|
|
|
11
17
|
super();
|
|
@@ -23,5 +29,3 @@ class LineBasicNodeMaterial extends NodeMaterial {
|
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
export default LineBasicNodeMaterial;
|
|
26
|
-
|
|
27
|
-
LineBasicNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'LineBasic', LineBasicNodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
import { attribute } from '../../nodes/core/AttributeNode.js';
|
|
3
3
|
import { materialLineDashSize, materialLineGapSize, materialLineScale } from '../../nodes/accessors/MaterialNode.js';
|
|
4
4
|
import { dashSize, gapSize } from '../../nodes/core/PropertyNode.js';
|
|
@@ -10,6 +10,12 @@ const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
|
|
|
10
10
|
|
|
11
11
|
class LineDashedNodeMaterial extends NodeMaterial {
|
|
12
12
|
|
|
13
|
+
static get type() {
|
|
14
|
+
|
|
15
|
+
return 'LineDashedNodeMaterial';
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
constructor( parameters ) {
|
|
14
20
|
|
|
15
21
|
super();
|
|
@@ -49,5 +55,3 @@ class LineDashedNodeMaterial extends NodeMaterial {
|
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
export default LineDashedNodeMaterial;
|
|
52
|
-
|
|
53
|
-
LineDashedNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'LineDashed', LineDashedNodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
import { materialLightMap } from '../../nodes/accessors/MaterialNode.js';
|
|
3
3
|
import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js';
|
|
4
4
|
import BasicLightMapNode from '../../nodes/lighting/BasicLightMapNode.js';
|
|
@@ -12,6 +12,12 @@ const _defaultValues = /*@__PURE__*/ new MeshBasicMaterial();
|
|
|
12
12
|
|
|
13
13
|
class MeshBasicNodeMaterial extends NodeMaterial {
|
|
14
14
|
|
|
15
|
+
static get type() {
|
|
16
|
+
|
|
17
|
+
return 'MeshBasicNodeMaterial';
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
constructor( parameters ) {
|
|
16
22
|
|
|
17
23
|
super();
|
|
@@ -69,5 +75,3 @@ class MeshBasicNodeMaterial extends NodeMaterial {
|
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
export default MeshBasicNodeMaterial;
|
|
72
|
-
|
|
73
|
-
MeshBasicNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'MeshBasic', MeshBasicNodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js';
|
|
3
3
|
import PhongLightingModel from '../../nodes/functions/PhongLightingModel.js';
|
|
4
4
|
|
|
@@ -8,6 +8,12 @@ const _defaultValues = /*@__PURE__*/ new MeshLambertMaterial();
|
|
|
8
8
|
|
|
9
9
|
class MeshLambertNodeMaterial extends NodeMaterial {
|
|
10
10
|
|
|
11
|
+
static get type() {
|
|
12
|
+
|
|
13
|
+
return 'MeshLambertNodeMaterial';
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
constructor( parameters ) {
|
|
12
18
|
|
|
13
19
|
super();
|
|
@@ -39,5 +45,3 @@ class MeshLambertNodeMaterial extends NodeMaterial {
|
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
export default MeshLambertNodeMaterial;
|
|
42
|
-
|
|
43
|
-
MeshLambertNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'MeshLambert', MeshLambertNodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
import { materialReference } from '../../nodes/accessors/MaterialReferenceNode.js';
|
|
3
3
|
import { diffuseColor } from '../../nodes/core/PropertyNode.js';
|
|
4
4
|
import { vec3 } from '../../nodes/tsl/TSLBase.js';
|
|
@@ -11,6 +11,12 @@ const _defaultValues = /*@__PURE__*/ new MeshMatcapMaterial();
|
|
|
11
11
|
|
|
12
12
|
class MeshMatcapNodeMaterial extends NodeMaterial {
|
|
13
13
|
|
|
14
|
+
static get type() {
|
|
15
|
+
|
|
16
|
+
return 'MeshMatcapNodeMaterial';
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
constructor( parameters ) {
|
|
15
21
|
|
|
16
22
|
super();
|
|
@@ -49,5 +55,3 @@ class MeshMatcapNodeMaterial extends NodeMaterial {
|
|
|
49
55
|
|
|
50
56
|
|
|
51
57
|
export default MeshMatcapNodeMaterial;
|
|
52
|
-
|
|
53
|
-
MeshMatcapNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'MeshMatcap', MeshMatcapNodeMaterial );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import NodeMaterial
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
2
|
import { diffuseColor } from '../../nodes/core/PropertyNode.js';
|
|
3
3
|
import { directionToColor } from '../../nodes/utils/Packing.js';
|
|
4
4
|
import { materialOpacity } from '../../nodes/accessors/MaterialNode.js';
|
|
@@ -11,6 +11,12 @@ const _defaultValues = /*@__PURE__*/ new MeshNormalMaterial();
|
|
|
11
11
|
|
|
12
12
|
class MeshNormalNodeMaterial extends NodeMaterial {
|
|
13
13
|
|
|
14
|
+
static get type() {
|
|
15
|
+
|
|
16
|
+
return 'MeshNormalNodeMaterial';
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
constructor( parameters ) {
|
|
15
21
|
|
|
16
22
|
super();
|
|
@@ -36,5 +42,3 @@ class MeshNormalNodeMaterial extends NodeMaterial {
|
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
export default MeshNormalNodeMaterial;
|
|
39
|
-
|
|
40
|
-
MeshNormalNodeMaterial.type = /*@__PURE__*/ registerNodeMaterial( 'MeshNormal', MeshNormalNodeMaterial );
|