three-stdlib 2.14.3 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/csm/CSM.cjs.js +1 -1
  2. package/csm/CSM.js +8 -8
  3. package/csm/CSMFrustum.cjs.js +1 -0
  4. package/csm/CSMFrustum.d.ts +19 -0
  5. package/csm/{Frustum.js → CSMFrustum.js} +8 -7
  6. package/csm/CSMShader.cjs.js +1 -0
  7. package/csm/CSMShader.d.ts +4 -0
  8. package/csm/{Shader.js → CSMShader.js} +52 -36
  9. package/curves/CurveExtras.d.ts +52 -54
  10. package/geometries/ParametricGeometries.cjs.js +1 -1
  11. package/geometries/ParametricGeometries.js +91 -99
  12. package/geometries/ParametricGeometry.cjs.js +1 -0
  13. package/geometries/ParametricGeometry.d.ts +18 -0
  14. package/geometries/ParametricGeometry.js +87 -0
  15. package/index.cjs.js +1 -1
  16. package/index.d.ts +3 -77
  17. package/index.js +4 -1
  18. package/interactive/InteractiveGroup.cjs.js +1 -0
  19. package/interactive/InteractiveGroup.d.ts +5 -0
  20. package/interactive/InteractiveGroup.js +87 -0
  21. package/loaders/GLTFLoader.d.ts +2 -9
  22. package/loaders/LUT3dlLoader.d.ts +2 -2
  23. package/loaders/LUTCubeLoader.d.ts +2 -2
  24. package/loaders/VOXLoader.d.ts +2 -2
  25. package/objects/Reflector.d.ts +1 -0
  26. package/objects/ReflectorForSSRPass.d.ts +4 -4
  27. package/objects/Refractor.d.ts +1 -0
  28. package/objects/Water2.d.ts +1 -1
  29. package/package.json +2 -1
  30. package/postprocessing/LUTPass.d.ts +3 -3
  31. package/postprocessing/SSAARenderPass.d.ts +1 -1
  32. package/postprocessing/SSRPass.d.ts +3 -3
  33. package/shaders/BokehShader2.d.ts +27 -72
  34. package/shaders/BokehShader2.js +0 -1
  35. package/shaders/index.cjs.js +1 -1
  36. package/shaders/index.d.ts +2 -1
  37. package/shaders/index.js +1 -1
  38. package/csm/Frustum.cjs.js +0 -1
  39. package/csm/Shader.cjs.js +0 -1
  40. package/loaders/VRMLoader.d.ts +0 -19
  41. package/nodes/Nodes.d.ts +0 -106
  42. package/nodes/accessors/CameraNode.d.ts +0 -29
  43. package/nodes/accessors/NormalNode.d.ts +0 -13
  44. package/nodes/accessors/PositionNode.d.ts +0 -15
  45. package/nodes/accessors/ReflectNode.d.ts +0 -12
  46. package/nodes/accessors/UVNode.d.ts +0 -10
  47. package/nodes/core/AttributeNode.d.ts +0 -13
  48. package/nodes/core/ConstNode.d.ts +0 -22
  49. package/nodes/core/ExpressionNode.d.ts +0 -5
  50. package/nodes/core/FunctionCallNode.d.ts +0 -17
  51. package/nodes/core/FunctionNode.d.ts +0 -28
  52. package/nodes/core/InputNode.d.ts +0 -12
  53. package/nodes/core/Node.d.ts +0 -34
  54. package/nodes/core/NodeBuilder.d.ts +0 -149
  55. package/nodes/core/NodeFrame.d.ts +0 -17
  56. package/nodes/core/NodeUniform.d.ts +0 -17
  57. package/nodes/core/NodeUtils.d.ts +0 -7
  58. package/nodes/core/TempNode.d.ts +0 -23
  59. package/nodes/core/VarNode.d.ts +0 -12
  60. package/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -21
  61. package/nodes/materials/NodeMaterial.d.ts +0 -28
  62. package/nodes/math/CondNode.d.ts +0 -26
  63. package/nodes/math/MathNode.d.ts +0 -57
  64. package/nodes/math/OperatorNode.d.ts +0 -17
  65. package/nodes/procedural/CheckerNode.d.ts +0 -17
  66. package/nodes/utils/JoinNode.d.ts +0 -15
  67. package/nodes/utils/TimerNode.d.ts +0 -19
  68. package/objects/ReflectorRTT.d.ts +0 -6
@@ -1 +0,0 @@
1
- "use strict";var e=require("three");const t=new e.Matrix4;class r{constructor(t){t=t||{},this.vertices={near:[new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3],far:[new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3]},void 0!==t.projectionMatrix&&this.setFromProjectionMatrix(t.projectionMatrix,t.maxFar||1e4)}setFromProjectionMatrix(e,r){const s=0===e.elements[11];return t.copy(e).invert(),this.vertices.near[0].set(1,1,-1),this.vertices.near[1].set(1,-1,-1),this.vertices.near[2].set(-1,-1,-1),this.vertices.near[3].set(-1,1,-1),this.vertices.near.forEach((e=>{e.applyMatrix4(t)})),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach((e=>{e.applyMatrix4(t);const i=Math.abs(e.z);s?e.z*=Math.min(r/i,1):e.multiplyScalar(Math.min(r/i,1))})),this.vertices}split(e,t){for(;e.length>t.length;)t.push(new r);t.length=e.length;for(let r=0;r<e.length;r++){const s=t[r];if(0===r)for(let e=0;e<4;e++)s.vertices.near[e].copy(this.vertices.near[e]);else for(let t=0;t<4;t++)s.vertices.near[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[r-1]);if(r===e-1)for(let e=0;e<4;e++)s.vertices.far[e].copy(this.vertices.far[e]);else for(let t=0;t<4;t++)s.vertices.far[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[r])}}toSpace(e,t){for(let r=0;r<4;r++)t.vertices.near[r].copy(this.vertices.near[r]).applyMatrix4(e),t.vertices.far[r].copy(this.vertices.far[r]).applyMatrix4(e)}}module.exports=r;
package/csm/Shader.cjs.js DELETED
@@ -1 +0,0 @@
1
- "use strict";var t={lights_fragment_begin:"\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\tvec2 cascade;\n\tfloat cascadeCenter;\n\tfloat closestEdge;\n\tfloat margin;\n\tfloat csmx;\n\tfloat csmy;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t// NOTE: Depth gets larger away from the camera.\n\t\t// cascade.x is closer, cascade.y is further\n\t\tcascade = CSM_cascades[ i ];\n\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\tcsmx = cascade.x - margin / 2.0;\n\t\tcsmy = cascade.y + margin / 2.0;\n\t\tif( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS && linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\t\t\tif( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) {\n\n\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t}\n\n\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t}\n\n\t}\n\t#pragma unroll_loop_end\n\t#else\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t#endif\n\n\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_pars_begin:"\n#if defined( USE_CSM ) && defined( CSM_CASCADES )\nuniform vec2 CSM_cascades[CSM_CASCADES];\nuniform float cameraNear;\nuniform float shadowFar;\n#endif\n\t"+require("three").ShaderChunk.lights_pars_begin};module.exports=t;
@@ -1,19 +0,0 @@
1
- import { Loader, LoadingManager } from 'three';
2
-
3
- import { GLTFLoader, GLTF } from './GLTFLoader';
4
- import { DRACOLoader } from './DRACOLoader';
5
-
6
- export class VRMLoader extends Loader {
7
- constructor(manager?: LoadingManager);
8
- gltfLoader: GLTFLoader;
9
-
10
- load(
11
- url: string,
12
- onLoad: (scene: GLTF) => void,
13
- onProgress?: (event: ProgressEvent) => void,
14
- onError?: (event: ErrorEvent) => void,
15
- ): void;
16
- loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<GLTF>;
17
- parse(gltf: GLTF, onLoad: (scene: GLTF) => void): void;
18
- setDRACOLoader(dracoLoader: DRACOLoader): this;
19
- }
package/nodes/Nodes.d.ts DELETED
@@ -1,106 +0,0 @@
1
- // core
2
-
3
- export * from './core/Node';
4
- export * from './core/TempNode';
5
- export * from './core/InputNode';
6
- export * from './core/ConstNode';
7
- export * from './core/VarNode';
8
- export * from './core/StructNode';
9
- export * from './core/AttributeNode';
10
- export * from './core/FunctionNode';
11
- export * from './core/ExpressionNode';
12
- export * from './core/FunctionCallNode';
13
- export * from './core/NodeLib';
14
- export * from './core/NodeUtils';
15
- export * from './core/NodeFrame';
16
- export * from './core/NodeUniform';
17
- export * from './core/NodeBuilder';
18
-
19
- // inputs
20
-
21
- export * from './inputs/BoolNode';
22
- export * from './inputs/IntNode';
23
- export * from './inputs/FloatNode';
24
- export * from './inputs/Vector2Node';
25
- export * from './inputs/Vector3Node';
26
- export * from './inputs/Vector4Node';
27
- export * from './inputs/ColorNode';
28
- export * from './inputs/Matrix3Node';
29
- export * from './inputs/Matrix4Node';
30
- export * from './inputs/TextureNode';
31
- export * from './inputs/CubeTextureNode';
32
- export * from './inputs/ScreenNode';
33
- export * from './inputs/ReflectorNode';
34
- export * from './inputs/PropertyNode';
35
- export * from './inputs/RTTNode';
36
-
37
- // accessors
38
-
39
- export * from './accessors/UVNode';
40
- export * from './accessors/ColorsNode';
41
- export * from './accessors/PositionNode';
42
- export * from './accessors/NormalNode';
43
- export * from './accessors/CameraNode';
44
- export * from './accessors/LightNode';
45
- export * from './accessors/ReflectNode';
46
- export * from './accessors/ScreenUVNode';
47
- export * from './accessors/ResolutionNode';
48
-
49
- // math
50
-
51
- export * from './math/MathNode';
52
- export * from './math/OperatorNode';
53
- export * from './math/CondNode';
54
-
55
- // procedural
56
-
57
- export * from './procedural/NoiseNode';
58
- export * from './procedural/CheckerNode';
59
-
60
- // misc
61
-
62
- export * from './misc/TextureCubeUVNode';
63
- export * from './misc/TextureCubeNode';
64
- export * from './misc/NormalMapNode';
65
- export * from './misc/BumpMapNode';
66
-
67
- // utils
68
-
69
- export * from './utils/BypassNode';
70
- export * from './utils/JoinNode';
71
- export * from './utils/SwitchNode';
72
- export * from './utils/TimerNode';
73
- export * from './utils/VelocityNode';
74
- export * from './utils/UVTransformNode';
75
- export * from './utils/MaxMIPLevelNode';
76
- export * from './utils/SpecularMIPLevelNode';
77
- export * from './utils/ColorSpaceNode';
78
-
79
- // effects
80
-
81
- export * from './effects/BlurNode';
82
- export * from './effects/ColorAdjustmentNode';
83
- export * from './effects/LuminanceNode';
84
-
85
- // material nodes
86
-
87
- export * from './materials/nodes/RawNode';
88
- export * from './materials/nodes/BasicNode';
89
- export * from './materials/nodes/SpriteNode';
90
- export * from './materials/nodes/PhongNode';
91
- export * from './materials/nodes/StandardNode';
92
- export * from './materials/nodes/MeshStandardNode';
93
-
94
- // materials
95
-
96
- export * from './materials/NodeMaterial';
97
- export * from './materials/BasicNodeMaterial';
98
- export * from './materials/SpriteNodeMaterial';
99
- export * from './materials/PhongNodeMaterial';
100
- export * from './materials/StandardNodeMaterial';
101
- export * from './materials/MeshStandardNodeMaterial';
102
-
103
- // postprocessing
104
-
105
- export * from './postprocessing/NodePostProcessing';
106
- // export * from './postprocessing/NodePass';
@@ -1,29 +0,0 @@
1
- import { Camera } from 'three';
2
-
3
- import { NodeFrame } from '../core/NodeFrame';
4
- import { TempNode } from '../core/TempNode';
5
- import { FunctionNode } from '../core/FunctionNode';
6
- import { FloatNode } from '../inputs/FloatNode';
7
-
8
- export class CameraNode extends TempNode {
9
- constructor(scope?: string, camera?: Camera);
10
-
11
- scope: string;
12
- near: FloatNode | undefined;
13
- far: FloatNode | undefined;
14
- camera: Camera | undefined;
15
- updateFrame: boolean | undefined;
16
- nodeType: string;
17
-
18
- setCamera(camera: Camera): void;
19
- setScope(scope: string): void;
20
- onUpdateFrame(frame: NodeFrame): void;
21
- copy(source: CameraNode): this;
22
-
23
- static Nodes: {
24
- depthColor: FunctionNode;
25
- };
26
- static POSITION: string;
27
- static DEPTH: string;
28
- static TO_VERTEX: string;
29
- }
@@ -1,13 +0,0 @@
1
- import { TempNode } from '../core/TempNode';
2
-
3
- export class NormalNode extends TempNode {
4
- constructor(scope?: string);
5
-
6
- scope: string;
7
- nodeType: string;
8
-
9
- copy(source: NormalNode): this;
10
-
11
- static LOCAL: string;
12
- static WORLD: string;
13
- }
@@ -1,15 +0,0 @@
1
- import { TempNode } from '../core/TempNode';
2
-
3
- export class PositionNode extends TempNode {
4
- constructor(scope?: string);
5
-
6
- scope: string;
7
- nodeType: string;
8
-
9
- copy(source: PositionNode): this;
10
-
11
- static LOCAL: string;
12
- static WORLD: string;
13
- static VIEW: string;
14
- static PROJECTION: string;
15
- }
@@ -1,12 +0,0 @@
1
- import { TempNode } from '../core/TempNode';
2
-
3
- export class ReflectNode extends TempNode {
4
- constructor(scope?: string);
5
-
6
- scope: string;
7
- nodeType: string;
8
-
9
- static CUBE: string;
10
- static SPHERE: string;
11
- static VECTOR: string;
12
- }
@@ -1,10 +0,0 @@
1
- import { TempNode } from '../core/TempNode';
2
-
3
- export class UVNode extends TempNode {
4
- constructor(index?: number);
5
-
6
- index: number;
7
- nodeType: string;
8
-
9
- copy(source: UVNode): this;
10
- }
@@ -1,13 +0,0 @@
1
- import { TempNode } from './TempNode';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export class AttributeNode extends TempNode {
5
- constructor(name: string, type?: string);
6
-
7
- name: string;
8
- nodeType: string;
9
-
10
- getAttributeType(builder: NodeBuilder): string;
11
- getType(builder: NodeBuilder): string;
12
- copy(source: AttributeNode): this;
13
- }
@@ -1,22 +0,0 @@
1
- import { TempNode } from './TempNode';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export class ConstNode extends TempNode {
5
- constructor(src: string, useDefine?: boolean);
6
-
7
- src: string;
8
- useDefine: boolean;
9
- nodeType: string;
10
-
11
- getType(builder: NodeBuilder): string;
12
- parse(src: string, useDefine?: boolean): void;
13
- build(builder: NodeBuilder, output: string): string;
14
- copy(source: ConstNode): this;
15
-
16
- static PI: string;
17
- static PI2: string;
18
- static RECIPROCAL_PI: string;
19
- static RECIPROCAL_PI2: string;
20
- static LOG2: string;
21
- static EPSILON: string;
22
- }
@@ -1,5 +0,0 @@
1
- import { FunctionNode } from './FunctionNode';
2
-
3
- export class ExpressionNode extends FunctionNode {
4
- constructor(src: string, type?: string, keywords?: object, extensions?: object, includes?: object[]);
5
- }
@@ -1,17 +0,0 @@
1
- import { Node } from './Node';
2
- import { FunctionNode } from './FunctionNode';
3
- import { TempNode } from './TempNode';
4
-
5
- export class FunctionCallNode extends TempNode {
6
- constructor(func: FunctionNode, inputs?: Node[]);
7
-
8
- nodeType: string;
9
-
10
- value: FunctionNode;
11
- inputs: Node[];
12
-
13
- setFunction(func: FunctionNode, inputs?: Node[]): void;
14
- getFunction(): FunctionNode;
15
- getType(): string;
16
- copy(source: FunctionCallNode): this;
17
- }
@@ -1,28 +0,0 @@
1
- import { TempNode } from './TempNode';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export interface FunctionNodeInput {
5
- name: string;
6
- type: string;
7
- qualifier: string;
8
- }
9
-
10
- export class FunctionNode extends TempNode {
11
- constructor(src: string, includes?: object[], extensions?: object, keywords?: object, type?: string);
12
-
13
- isMethod: boolean;
14
- nodeType: string;
15
- useKeywords: boolean;
16
-
17
- inputs: FunctionNodeInput[] | undefined;
18
- includes: object[] | undefined;
19
- extensions: object | undefined;
20
- keywords: object | undefined;
21
-
22
- getShared(builder: NodeBuilder, output: string): boolean;
23
- getType(builder: NodeBuilder): string;
24
- getInputByName(name: string): FunctionNodeInput | undefined;
25
- getIncludeByName(name: string): object | undefined;
26
- parse(src: string, includes?: object[], extensions?: object, keywords?: object): void;
27
- copy(source: FunctionNode): this;
28
- }
@@ -1,12 +0,0 @@
1
- import { TempNode, TempNodeParams } from './TempNode';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export class InputNode extends TempNode {
5
- constructor(type: string, params?: TempNodeParams);
6
-
7
- readonly: boolean;
8
-
9
- setReadonly(value: boolean): this;
10
- getReadonly(builder: NodeBuilder): boolean;
11
- copy(source: InputNode): this;
12
- }
@@ -1,34 +0,0 @@
1
- import { NodeBuilder } from './NodeBuilder';
2
-
3
- export interface Flow {
4
- result: string;
5
- code: string;
6
- extra: object;
7
- }
8
-
9
- export class Node {
10
- constructor(type?: string);
11
-
12
- uuid: string;
13
- name: string;
14
- type: string | undefined;
15
- userData: object;
16
- readonly isNode: true;
17
- frameId: number | undefined;
18
- hashProperties: string[] | undefined;
19
-
20
- analyze(builder: NodeBuilder, settings?: object): void;
21
- analyzeAndFlow(builder: NodeBuilder, output: string, settings?: object): Flow;
22
- flow(builder: NodeBuilder, output: string, settings?: object): Flow;
23
- build(builder: NodeBuilder, output: string, uuid?: string): string;
24
- generate(builder: NodeBuilder, output: string, uuid?: string, type?: string, ns?: string): string;
25
- appendDepsNode(builder: NodeBuilder, data: object, output: string): void;
26
- setName(name: string): this;
27
- getName(builder: NodeBuilder): string;
28
- getType(builder: NodeBuilder, output?: string): string;
29
- getJSONNode(meta?: object | string): object | undefined;
30
- getHash(): string;
31
- copy(source: Node): this;
32
- createJSONNode(meta?: object | string): object;
33
- toJSON(meta?: object | string): object;
34
- }
@@ -1,149 +0,0 @@
1
- import { Material, Texture, TextureEncoding, WebGLRenderer } from 'three';
2
-
3
- import { Node } from './Node';
4
- import { NodeUniform } from './NodeUniform';
5
-
6
- export class NodeBuilder {
7
- constructor();
8
-
9
- slots: string[];
10
- caches: string[];
11
- contexts: object[];
12
-
13
- keywords: object;
14
- nodeData: object;
15
-
16
- requires: {
17
- uv: boolean[];
18
- color: boolean[];
19
- lights: boolean;
20
- fog: boolean;
21
- transparent: boolean;
22
- irradiance: boolean;
23
- };
24
-
25
- includes: {
26
- consts: object[];
27
- functions: object[];
28
- structs: object[];
29
- };
30
-
31
- attributes: object;
32
- prefixCode: string;
33
-
34
- parsCode: {
35
- vertex: string;
36
- fragment: string;
37
- };
38
-
39
- code: {
40
- vertex: string;
41
- fragment: string;
42
- };
43
-
44
- nodeCode: {
45
- vertex: string;
46
- fragment: string;
47
- };
48
-
49
- resultCode: {
50
- vertex: string;
51
- fragment: string;
52
- };
53
-
54
- finalCode: {
55
- vertex: string;
56
- fragment: string;
57
- };
58
-
59
- inputs: {
60
- uniforms: {
61
- list: object[];
62
- vertex: object[];
63
- fragment: object[];
64
- };
65
- vars: {
66
- varying: object[];
67
- vertex: object[];
68
- fragment: object[];
69
- };
70
- };
71
-
72
- defines: object;
73
- uniforms: object;
74
- extensions: object;
75
- updaters: object[];
76
- nodes: object[];
77
-
78
- analyzing: boolean;
79
-
80
- build(vertex: Node, fragment: Node): this;
81
- buildShader(shader: string, node: Node): void;
82
- setMaterial(material: Material, renderer: WebGLRenderer): this;
83
- addFlow(slot: string, cache?: string, context?: object): this;
84
- removeFlow(): this;
85
- addCache(name: string): this;
86
- removeCache(): this;
87
- addContext(context: object): this;
88
- removeContext(): this;
89
- addSlot(name: string): this;
90
- removeSlot(): this;
91
- addVertexCode(code: string): void;
92
- addFragmentCode(code: string): void;
93
- addCode(code: string, shader?: string): void;
94
- addVertexNodeCode(code: string): void;
95
- addFragmentNodeCode(code: string): void;
96
- addNodeCode(code: string, shader?: string): void;
97
- clearNodeCode(shader: string): string;
98
- clearVertexNodeCode(): string;
99
- clearFragmentNodeCode(): string;
100
- addVertexFinalCode(code: string): void;
101
- addFragmentFinalCode(code: string): void;
102
- addFinalCode(code: string, shader?: string): void;
103
- addVertexParsCode(code: string): void;
104
- addFragmentParsCode(code: string): void;
105
- addParsCode(code: string, shader?: string): void;
106
- addVaryCode(code: string): void;
107
- isCache(name: string): boolean;
108
- isSlot(name: string): boolean;
109
- define(name: string, value: any): void;
110
- isDefined(name: string): boolean;
111
- getVar(uuid: string, type: string, ns: string, labelOrShader?: string, prefix?: string, label?: string): object;
112
- getAttribute(name: string, type: string): any;
113
- getCode(shader: string): string;
114
- getVarListCode(vars: object[], prefix?: string): string;
115
- getVars(shader: string): object[];
116
- getNodeData(node: Node): object;
117
- createUniform(
118
- shader: string,
119
- type: string,
120
- node: Node,
121
- ns?: string,
122
- needsUpdate?: boolean,
123
- label?: string,
124
- ): NodeUniform;
125
- createVertexUniform(type: string, node: Node, ns?: string, needsUpdate?: boolean, label?: string): NodeUniform;
126
- createFragmentUniform(type: string, node: Node, ns?: string, needsUpdate?: boolean, label?: string): NodeUniform;
127
- include(node: Node, parent?: boolean, source?: string): void;
128
- colorToVectorProperties(color: string): string;
129
- colorToVector(color: string): string;
130
- getIncludes(type: string, shader: string): object[];
131
- getIncludesCode(type: string, shader: string): string;
132
- getConstructorFromLength(len: number): string;
133
- isTypeMatrix(format: string): boolean;
134
- getTypeLength(type: string): number;
135
- getTypeFromLength(len: number): string;
136
- findNode(): Node;
137
- resolve(): void;
138
- format(code: string, from: string, to: string): string;
139
- getTypeByFormat(format: string): string;
140
- getFormatByType(type: string): string;
141
- getUuid(uuid: string, useCache?: boolean): string;
142
- getElementByIndex(index: number): string;
143
- getIndexByElement(elm: string): number;
144
- isShader(shader: string): boolean;
145
- setShader(shader: string): this;
146
- mergeDefines(defines: object): object;
147
- mergeUniform(uniforms: object): object;
148
- getTextureEncodingFromMap(map: Texture): TextureEncoding;
149
- }
@@ -1,17 +0,0 @@
1
- import { Texture, WebGLRenderer } from 'three';
2
-
3
- import { Node } from './Node';
4
-
5
- export class NodeFrame {
6
- constructor(time: number);
7
- time: number;
8
- id: number;
9
- delta: number | undefined;
10
- renderer: WebGLRenderer | undefined;
11
- renderTexture: Texture | undefined;
12
-
13
- update(delta: number): this;
14
- setRenderer(renderer: WebGLRenderer): this;
15
- setRenderTexture(renderTexture: Texture): this;
16
- updateNode(node: Node): this;
17
- }
@@ -1,17 +0,0 @@
1
- import { Node } from './Node';
2
-
3
- export interface NodeUniformParams {
4
- name?: string;
5
- type?: string;
6
- node?: Node;
7
- needsUpdate?: boolean;
8
- }
9
-
10
- export class NodeUniform {
11
- constructor(params?: NodeUniformParams);
12
- name: string | undefined;
13
- type: string | undefined;
14
- node: Node | undefined;
15
- needsUpdate: boolean | undefined;
16
- value: any;
17
- }
@@ -1,7 +0,0 @@
1
- import { Node } from './Node';
2
-
3
- export namespace NodeUtils {
4
- const elements: string[];
5
-
6
- function addShortcuts(proto: Node, proxy: string, list: any[]): void;
7
- }
@@ -1,23 +0,0 @@
1
- import { Node } from './Node';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export interface TempNodeParams {
5
- shared?: boolean;
6
- unique?: boolean;
7
- }
8
-
9
- export class TempNode extends Node {
10
- constructor(type: string, params?: TempNodeParams);
11
-
12
- shared: boolean;
13
- unique: boolean;
14
- label: string | undefined;
15
-
16
- build(builder: NodeBuilder, output: string, uuid?: string, ns?: string): string;
17
- getShared(builder: NodeBuilder, output: string): boolean;
18
- getUnique(builder: NodeBuilder, output: string): boolean;
19
- setLabel(name: string): this;
20
- getLabel(builder: NodeBuilder): string;
21
- getUuid(unique: boolean): string;
22
- getTemp(builder: NodeBuilder, uuid: string): string | undefined;
23
- }
@@ -1,12 +0,0 @@
1
- import { Node } from './Node';
2
- import { NodeBuilder } from './NodeBuilder';
3
-
4
- export class VarNode extends Node {
5
- constructor(type: string, value?: any);
6
-
7
- value: any;
8
- nodeType: string;
9
-
10
- getType(builder: NodeBuilder): string;
11
- copy(source: VarNode): this;
12
- }
@@ -1,21 +0,0 @@
1
- import { Color } from '../../../../src/math/Color';
2
- import { Texture } from '../../../../src/textures/Texture';
3
- import { CubeTexture } from '../../../../src/textures/CubeTexture';
4
- import { Vector2 } from '../../../../src/math/Vector2';
5
-
6
- import { Node } from '../core/Node';
7
- import { NodeMaterial } from './NodeMaterial';
8
-
9
- export class MeshStandardNodeMaterial extends NodeMaterial {
10
- constructor();
11
-
12
- color: Color | Node;
13
- roughness: number | Node;
14
- metalness: number | Node;
15
- map: Texture | Node;
16
- normalMap: Texture | Node;
17
- normalScale: Vector2 | Node;
18
- metalnessMap: Texture | Node;
19
- roughnessMap: Texture | Node;
20
- envMap: CubeTexture | Node;
21
- }
@@ -1,28 +0,0 @@
1
- import { ShaderMaterial, WebGLRenderer } from 'three';
2
-
3
- import { Node } from '../core/Node.js';
4
- import { NodeBuilder } from '../core/NodeBuilder';
5
- import { NodeFrame } from '../core/NodeFrame';
6
- import { RawNode } from './nodes/RawNode';
7
-
8
- export interface NodeMaterialBuildParams {
9
- builder?: NodeBuilder;
10
- renderer?: WebGLRenderer;
11
- }
12
-
13
- export class NodeMaterial extends ShaderMaterial {
14
- constructor(vertex: Node, fragment: Node);
15
-
16
- vertex: Node | RawNode;
17
- fragment: Node | RawNode;
18
-
19
- updaters: object[];
20
-
21
- readonly isNodeMaterial: true;
22
- properties: object;
23
-
24
- updateFrame(frame: NodeFrame): void;
25
- build(params?: NodeMaterialBuildParams): this;
26
- getHash(): string;
27
- copy(source: NodeMaterial): this;
28
- }