three-stdlib 2.14.3 → 2.15.1

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.
Files changed (72) 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/ConvexGeometry.cjs.js +1 -1
  11. package/geometries/ConvexGeometry.js +1 -1
  12. package/geometries/ParametricGeometries.cjs.js +1 -1
  13. package/geometries/ParametricGeometries.js +91 -99
  14. package/geometries/ParametricGeometry.cjs.js +1 -0
  15. package/geometries/ParametricGeometry.d.ts +18 -0
  16. package/geometries/ParametricGeometry.js +87 -0
  17. package/index.cjs.js +1 -1
  18. package/index.d.ts +57 -77
  19. package/index.js +55 -52
  20. package/interactive/InteractiveGroup.cjs.js +1 -0
  21. package/interactive/InteractiveGroup.d.ts +5 -0
  22. package/interactive/InteractiveGroup.js +87 -0
  23. package/loaders/GLTFLoader.d.ts +2 -9
  24. package/loaders/LUT3dlLoader.d.ts +2 -2
  25. package/loaders/LUTCubeLoader.d.ts +2 -2
  26. package/loaders/VOXLoader.d.ts +2 -2
  27. package/math/ConvexHull.cjs.js +1 -1
  28. package/math/ConvexHull.js +639 -603
  29. package/objects/Reflector.d.ts +1 -0
  30. package/objects/ReflectorForSSRPass.d.ts +4 -4
  31. package/objects/Refractor.d.ts +1 -0
  32. package/objects/Water2.d.ts +1 -1
  33. package/package.json +2 -1
  34. package/postprocessing/LUTPass.d.ts +3 -3
  35. package/postprocessing/SSAARenderPass.d.ts +1 -1
  36. package/postprocessing/SSRPass.d.ts +3 -3
  37. package/shaders/BokehShader2.d.ts +27 -72
  38. package/shaders/BokehShader2.js +0 -1
  39. package/csm/Frustum.cjs.js +0 -1
  40. package/csm/Shader.cjs.js +0 -1
  41. package/loaders/VRMLoader.d.ts +0 -19
  42. package/nodes/Nodes.d.ts +0 -106
  43. package/nodes/accessors/CameraNode.d.ts +0 -29
  44. package/nodes/accessors/NormalNode.d.ts +0 -13
  45. package/nodes/accessors/PositionNode.d.ts +0 -15
  46. package/nodes/accessors/ReflectNode.d.ts +0 -12
  47. package/nodes/accessors/UVNode.d.ts +0 -10
  48. package/nodes/core/AttributeNode.d.ts +0 -13
  49. package/nodes/core/ConstNode.d.ts +0 -22
  50. package/nodes/core/ExpressionNode.d.ts +0 -5
  51. package/nodes/core/FunctionCallNode.d.ts +0 -17
  52. package/nodes/core/FunctionNode.d.ts +0 -28
  53. package/nodes/core/InputNode.d.ts +0 -12
  54. package/nodes/core/Node.d.ts +0 -34
  55. package/nodes/core/NodeBuilder.d.ts +0 -149
  56. package/nodes/core/NodeFrame.d.ts +0 -17
  57. package/nodes/core/NodeUniform.d.ts +0 -17
  58. package/nodes/core/NodeUtils.d.ts +0 -7
  59. package/nodes/core/TempNode.d.ts +0 -23
  60. package/nodes/core/VarNode.d.ts +0 -12
  61. package/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -21
  62. package/nodes/materials/NodeMaterial.d.ts +0 -28
  63. package/nodes/math/CondNode.d.ts +0 -26
  64. package/nodes/math/MathNode.d.ts +0 -57
  65. package/nodes/math/OperatorNode.d.ts +0 -17
  66. package/nodes/procedural/CheckerNode.d.ts +0 -17
  67. package/nodes/utils/JoinNode.d.ts +0 -15
  68. package/nodes/utils/TimerNode.d.ts +0 -19
  69. package/objects/ReflectorRTT.d.ts +0 -6
  70. package/shaders/index.cjs.js +0 -1
  71. package/shaders/index.d.ts +0 -53
  72. package/shaders/index.js +0 -53
@@ -7,6 +7,7 @@ export interface ReflectorOptions {
7
7
  clipBias?: number;
8
8
  shader?: object;
9
9
  encoding?: TextureEncoding;
10
+ multisample?: number;
10
11
  }
11
12
 
12
13
  export class Reflector extends Mesh {
@@ -21,7 +21,7 @@ export interface ReflectorShader {
21
21
  fragmentShader: string;
22
22
  }
23
23
 
24
- export interface ReflectorOptions {
24
+ export interface ReflectorForSSRPassOptions {
25
25
  clipBias?: number | undefined;
26
26
  textureWidth?: number | undefined;
27
27
  textureHeight?: number | undefined;
@@ -30,9 +30,9 @@ export interface ReflectorOptions {
30
30
  shader?: ReflectorShader | undefined;
31
31
  }
32
32
 
33
- export class Reflector<TGeometry extends BufferGeometry = BufferGeometry> extends Mesh<TGeometry> {
33
+ export class ReflectorForSSRPass<TGeometry extends BufferGeometry = BufferGeometry> extends Mesh<TGeometry> {
34
34
  type: 'ReflectorForSSRPass';
35
- options: ReflectorOptions;
35
+ options: ReflectorForSSRPassOptions;
36
36
 
37
37
  static ReflectorShader: ReflectorShader;
38
38
 
@@ -49,7 +49,7 @@ export class Reflector<TGeometry extends BufferGeometry = BufferGeometry> extend
49
49
 
50
50
  renderTarget: WebGLRenderTarget;
51
51
 
52
- constructor(geometry: TGeometry, options: ReflectorOptions);
52
+ constructor(geometry: TGeometry, options: ReflectorForSSRPassOptions);
53
53
 
54
54
  doRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void;
55
55
 
@@ -7,6 +7,7 @@ export interface RefractorOptions {
7
7
  clipBias?: number;
8
8
  shader?: object;
9
9
  encoding?: TextureEncoding;
10
+ multisample?: number;
10
11
  }
11
12
 
12
13
  export class Refractor extends Mesh {
@@ -24,7 +24,7 @@ export interface Water2Options {
24
24
  encoding?: TextureEncoding;
25
25
  }
26
26
 
27
- export class Water extends Mesh {
27
+ export class Water2 extends Mesh {
28
28
  material: ShaderMaterial;
29
29
  constructor(geometry: BufferGeometry, options: Water2Options);
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-stdlib",
3
- "version": "2.14.3",
3
+ "version": "2.15.1",
4
4
  "private": false,
5
5
  "description": "stand-alone library of threejs examples",
6
6
  "main": "index.cjs.js",
@@ -21,6 +21,7 @@
21
21
  "homepage": "https://github.com/pmndrs/three-stdlib#readme",
22
22
  "dependencies": {
23
23
  "@babel/runtime": "^7.16.7",
24
+ "@types/offscreencanvas": "^2019.6.4",
24
25
  "@webgpu/glslang": "^0.0.15",
25
26
  "chevrotain": "^10.1.2",
26
27
  "draco3d": "^1.4.1",
@@ -1,13 +1,13 @@
1
- import { DataTexture, DataTexture3D } from 'three';
1
+ import { DataTexture, Data3DTexture } from 'three';
2
2
  import { ShaderPass } from './ShaderPass';
3
3
 
4
4
  export interface LUTPassParameters {
5
- lut?: DataTexture | DataTexture3D;
5
+ lut?: DataTexture | Data3DTexture;
6
6
  intensity?: number;
7
7
  }
8
8
 
9
9
  export class LUTPass extends ShaderPass {
10
- lut?: DataTexture | DataTexture3D;
10
+ lut?: DataTexture | Data3DTexture;
11
11
  intensity?: number;
12
12
  constructor(params: LUTPassParameters);
13
13
  }
@@ -3,7 +3,7 @@ import { Scene, Camera, ColorRepresentation, ShaderMaterial, WebGLRenderTarget }
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class SSAARenderPass extends Pass {
6
- constructor(scene: Scene, camera: Camera, clearColor: ColorRepresentation, clearAlpha: number);
6
+ constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number);
7
7
  scene: Scene;
8
8
  camera: Camera;
9
9
  sampleLevel: number;
@@ -12,7 +12,7 @@ import {
12
12
  ColorRepresentation,
13
13
  } from 'three';
14
14
  import { Pass, FullScreenQuad } from '../postprocessing/Pass';
15
- import { Reflector } from '../objects/ReflectorForSSRPass';
15
+ import { ReflectorForSSRPass } from '../objects/ReflectorForSSRPass';
16
16
 
17
17
  export interface SSRPassParams {
18
18
  renderer: WebGLRenderer;
@@ -23,7 +23,7 @@ export interface SSRPassParams {
23
23
  selects: Mesh[] | null;
24
24
  isPerspectiveCamera?: boolean | undefined;
25
25
  isBouncing?: boolean | undefined;
26
- groundReflector: Reflector | null;
26
+ groundReflector: ReflectorForSSRPass | null;
27
27
  }
28
28
 
29
29
  export class SSRPass extends Pass {
@@ -33,7 +33,7 @@ export class SSRPass extends Pass {
33
33
  renderer: WebGLRenderer;
34
34
  scene: Scene;
35
35
  camera: Camera;
36
- groundReflector: Reflector | null;
36
+ groundReflector: ReflectorForSSRPass | null;
37
37
  opacity: number;
38
38
  output: number;
39
39
  maxDistance: number;
@@ -1,76 +1,31 @@
1
- import { Vector2 } from 'three';
1
+ import { IUniform, Texture, Vector2 } from 'three';
2
+ export interface BokehShaderUniforms {
3
+ textureWidth: IUniform<number>;
4
+ textureHeight: IUniform<number>;
5
+ focalDepth: IUniform<number>;
6
+ focalLength: IUniform<number>;
7
+ fstop: IUniform<number>;
8
+ tColor: IUniform<Texture | null>;
9
+ tDepth: IUniform<Texture | null>;
10
+ maxblur: IUniform<number>;
11
+ showFocus: IUniform<number>;
12
+ manualdof: IUniform<number>;
13
+ vignetting: IUniform<number>;
14
+ depthblur: IUniform<number>;
15
+ threshold: IUniform<number>;
16
+ gain: IUniform<number>;
17
+ bias: IUniform<number>;
18
+ fringe: IUniform<number>;
19
+ znear: IUniform<number>;
20
+ zfar: IUniform<number>;
21
+ noise: IUniform<number>;
22
+ dithering: IUniform<number>;
23
+ pentagon: IUniform<number>;
24
+ shaderFocus: IUniform<number>;
25
+ focusCoords: IUniform<Vector2>;
26
+ }
2
27
  export declare const BokehShader2: {
3
- uniforms: {
4
- textureWidth: {
5
- value: number;
6
- };
7
- textureHeight: {
8
- value: number;
9
- };
10
- focalDepth: {
11
- value: number;
12
- };
13
- focalLength: {
14
- value: number;
15
- };
16
- fstop: {
17
- value: number;
18
- };
19
- tColor: {
20
- value: null;
21
- };
22
- tDepth: {
23
- value: null;
24
- };
25
- maxblur: {
26
- value: number;
27
- };
28
- showFocus: {
29
- value: number;
30
- };
31
- manualdof: {
32
- value: number;
33
- };
34
- vignetting: {
35
- value: number;
36
- };
37
- depthblur: {
38
- value: number;
39
- };
40
- threshold: {
41
- value: number;
42
- };
43
- gain: {
44
- value: number;
45
- };
46
- bias: {
47
- value: number;
48
- };
49
- fringe: {
50
- value: number;
51
- };
52
- znear: {
53
- value: number;
54
- };
55
- zfar: {
56
- value: number;
57
- };
58
- noise: {
59
- value: number;
60
- };
61
- dithering: {
62
- value: number;
63
- };
64
- pentagon: {
65
- value: number;
66
- };
67
- shaderFocus: {
68
- value: number;
69
- };
70
- focusCoords: {
71
- value: Vector2;
72
- };
73
- };
28
+ uniforms: BokehShaderUniforms;
74
29
  vertexShader: string;
75
30
  fragmentShader: string;
76
31
  };
@@ -7,7 +7,6 @@ import { Vector2 } from 'three';
7
7
  *
8
8
  * Requires #define RINGS and SAMPLES integers
9
9
  */
10
-
11
10
  const BokehShader2 = {
12
11
  uniforms: {
13
12
  textureWidth: {
@@ -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
- }