@plastic-software/three 0.178.0 → 0.179.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.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/build/three.cjs +856 -196
  3. package/build/three.core.js +647 -123
  4. package/build/three.core.min.js +1 -1
  5. package/build/three.module.js +211 -76
  6. package/build/three.module.min.js +1 -1
  7. package/build/three.tsl.js +70 -21
  8. package/build/three.tsl.min.js +1 -1
  9. package/build/three.webgpu.js +1796 -557
  10. package/build/three.webgpu.min.js +1 -1
  11. package/build/three.webgpu.nodes.js +1754 -557
  12. package/build/three.webgpu.nodes.min.js +1 -1
  13. package/examples/jsm/Addons.js +1 -2
  14. package/examples/jsm/capabilities/WebGPU.js +1 -1
  15. package/examples/jsm/csm/CSMShadowNode.js +4 -4
  16. package/examples/jsm/environments/RoomEnvironment.js +8 -3
  17. package/examples/jsm/exporters/USDZExporter.js +676 -299
  18. package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
  19. package/examples/jsm/interactive/HTMLMesh.js +5 -3
  20. package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
  21. package/examples/jsm/lights/LightProbeGenerator.js +14 -3
  22. package/examples/jsm/loaders/EXRLoader.js +210 -22
  23. package/examples/jsm/loaders/FBXLoader.js +1 -1
  24. package/examples/jsm/loaders/MaterialXLoader.js +212 -30
  25. package/examples/jsm/loaders/TTFLoader.js +13 -1
  26. package/examples/jsm/loaders/USDLoader.js +219 -0
  27. package/examples/jsm/loaders/USDZLoader.js +4 -892
  28. package/examples/jsm/loaders/usd/USDAParser.js +741 -0
  29. package/examples/jsm/loaders/usd/USDCParser.js +17 -0
  30. package/examples/jsm/objects/LensflareMesh.js +3 -3
  31. package/examples/jsm/objects/SkyMesh.js +2 -2
  32. package/examples/jsm/physics/RapierPhysics.js +14 -5
  33. package/examples/jsm/postprocessing/GTAOPass.js +10 -9
  34. package/examples/jsm/postprocessing/OutlinePass.js +17 -17
  35. package/examples/jsm/postprocessing/SSAOPass.js +10 -9
  36. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
  37. package/examples/jsm/transpiler/GLSLDecoder.js +2 -2
  38. package/examples/jsm/tsl/display/BloomNode.js +8 -7
  39. package/examples/jsm/tsl/display/GaussianBlurNode.js +6 -8
  40. package/examples/jsm/tsl/display/{TRAAPassNode.js → TRAANode.js} +181 -172
  41. package/examples/jsm/tsl/lighting/TiledLightsNode.js +1 -1
  42. package/package.json +1 -1
  43. package/src/Three.Core.js +1 -0
  44. package/src/Three.TSL.js +69 -20
  45. package/src/animation/KeyframeTrack.js +1 -1
  46. package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
  47. package/src/animation/tracks/StringKeyframeTrack.js +1 -1
  48. package/src/cameras/Camera.js +14 -0
  49. package/src/cameras/OrthographicCamera.js +1 -1
  50. package/src/cameras/PerspectiveCamera.js +1 -1
  51. package/src/constants.js +1 -1
  52. package/{examples/jsm/misc → src/core}/Timer.js +4 -42
  53. package/src/extras/PMREMGenerator.js +11 -0
  54. package/src/helpers/CameraHelper.js +41 -11
  55. package/src/helpers/SkeletonHelper.js +35 -6
  56. package/src/lights/LightShadow.js +21 -8
  57. package/src/lights/PointLightShadow.js +1 -1
  58. package/src/loaders/FileLoader.js +25 -2
  59. package/src/loaders/ImageBitmapLoader.js +23 -0
  60. package/src/loaders/Loader.js +14 -0
  61. package/src/loaders/LoadingManager.js +23 -0
  62. package/src/materials/MeshBasicMaterial.js +1 -1
  63. package/src/materials/nodes/Line2NodeMaterial.js +0 -8
  64. package/src/materials/nodes/NodeMaterial.js +1 -1
  65. package/src/materials/nodes/PointsNodeMaterial.js +5 -0
  66. package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -2
  67. package/src/math/Frustum.js +19 -8
  68. package/src/math/FrustumArray.js +10 -5
  69. package/src/math/Line3.js +129 -2
  70. package/src/math/Matrix4.js +48 -27
  71. package/src/math/Spherical.js +2 -2
  72. package/src/nodes/Nodes.js +1 -0
  73. package/src/nodes/TSL.js +1 -0
  74. package/src/nodes/accessors/Camera.js +12 -12
  75. package/src/nodes/accessors/Normal.js +11 -11
  76. package/src/nodes/accessors/ReferenceNode.js +18 -3
  77. package/src/nodes/accessors/SceneNode.js +1 -1
  78. package/src/nodes/accessors/StorageTextureNode.js +1 -1
  79. package/src/nodes/accessors/TextureNode.js +12 -0
  80. package/src/nodes/core/ArrayNode.js +12 -0
  81. package/src/nodes/core/AssignNode.js +3 -0
  82. package/src/nodes/core/ContextNode.js +20 -1
  83. package/src/nodes/core/Node.js +14 -2
  84. package/src/nodes/core/NodeBuilder.js +25 -20
  85. package/src/nodes/core/NodeUtils.js +4 -1
  86. package/src/nodes/core/StackNode.js +42 -0
  87. package/src/nodes/core/UniformNode.js +63 -5
  88. package/src/nodes/core/VarNode.js +91 -2
  89. package/src/nodes/display/PassNode.js +148 -2
  90. package/src/nodes/display/ViewportTextureNode.js +67 -7
  91. package/src/nodes/functions/PhysicalLightingModel.js +2 -2
  92. package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
  93. package/src/nodes/gpgpu/ComputeNode.js +67 -23
  94. package/src/nodes/gpgpu/WorkgroupInfoNode.js +28 -3
  95. package/src/nodes/lighting/ProjectorLightNode.js +19 -6
  96. package/src/nodes/lighting/ShadowFilterNode.js +1 -1
  97. package/src/nodes/materialx/MaterialXNodes.js +131 -2
  98. package/src/nodes/materialx/lib/mx_noise.js +165 -1
  99. package/src/nodes/math/ConditionalNode.js +1 -1
  100. package/src/nodes/math/MathNode.js +78 -54
  101. package/src/nodes/math/OperatorNode.js +22 -22
  102. package/src/nodes/tsl/TSLCore.js +64 -9
  103. package/src/nodes/utils/DebugNode.js +1 -1
  104. package/src/nodes/utils/EventNode.js +83 -0
  105. package/src/nodes/utils/RTTNode.js +9 -0
  106. package/src/objects/BatchedMesh.js +4 -2
  107. package/src/renderers/WebGLRenderer.js +21 -22
  108. package/src/renderers/common/Bindings.js +19 -18
  109. package/src/renderers/common/Color4.js +2 -2
  110. package/src/renderers/common/PostProcessing.js +60 -5
  111. package/src/renderers/common/Renderer.js +18 -15
  112. package/src/renderers/common/SampledTexture.js +3 -71
  113. package/src/renderers/common/Sampler.js +79 -0
  114. package/src/renderers/common/Storage3DTexture.js +21 -0
  115. package/src/renderers/common/StorageArrayTexture.js +21 -0
  116. package/src/renderers/common/StorageTexture.js +19 -0
  117. package/src/renderers/common/Textures.js +19 -3
  118. package/src/renderers/common/XRManager.js +26 -8
  119. package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
  120. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +20 -2
  121. package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
  122. package/src/renderers/webgl/WebGLCapabilities.js +2 -2
  123. package/src/renderers/webgl/WebGLMaterials.js +6 -6
  124. package/src/renderers/webgl/WebGLProgram.js +22 -16
  125. package/src/renderers/webgl/WebGLPrograms.js +4 -4
  126. package/src/renderers/webgl/WebGLShadowMap.js +11 -1
  127. package/src/renderers/webgl/WebGLTextures.js +19 -7
  128. package/src/renderers/webgl-fallback/WebGLBackend.js +22 -12
  129. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +2 -2
  130. package/src/renderers/webgpu/WebGPUBackend.js +54 -15
  131. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +53 -73
  132. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +35 -31
  133. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1 -1
  134. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +11 -64
  135. package/src/renderers/webgpu/utils/WebGPUUtils.js +2 -17
  136. package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
  137. package/src/renderers/webxr/WebXRManager.js +68 -8
  138. package/src/textures/ExternalTexture.js +45 -0
  139. package/src/textures/FramebufferTexture.js +2 -2
  140. package/src/textures/Source.js +11 -1
  141. package/src/textures/VideoTexture.js +30 -2
@@ -1,6 +1,6 @@
1
1
  import TempNode from '../core/TempNode.js';
2
2
  import { sub, mul, div, mod, equal } from './OperatorNode.js';
3
- import { addMethodChaining, nodeObject, nodeProxy, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
3
+ import { addMethodChaining, nodeObject, nodeProxyIntent, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
4
4
  import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../../constants.js';
5
5
 
6
6
  /**
@@ -361,6 +361,8 @@ MathNode.RECIPROCAL = 'reciprocal';
361
361
  MathNode.TRUNC = 'trunc';
362
362
  MathNode.FWIDTH = 'fwidth';
363
363
  MathNode.TRANSPOSE = 'transpose';
364
+ MathNode.DETERMINANT = 'determinant';
365
+ MathNode.INVERSE = 'inverse';
364
366
 
365
367
  // 2 inputs
366
368
 
@@ -429,7 +431,7 @@ export const PI2 = /*@__PURE__*/ float( Math.PI * 2 );
429
431
  * @param {Node | number} x - The parameter.
430
432
  * @returns {Node<bool>}
431
433
  */
432
- export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL ).setParameterLength( 1 );
434
+ export const all = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ALL ).setParameterLength( 1 );
433
435
 
434
436
  /**
435
437
  * Returns `true` if any components of `x` are `true`.
@@ -439,7 +441,7 @@ export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL ).setParamete
439
441
  * @param {Node | number} x - The parameter.
440
442
  * @returns {Node<bool>}
441
443
  */
442
- export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY ).setParameterLength( 1 );
444
+ export const any = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ANY ).setParameterLength( 1 );
443
445
 
444
446
  /**
445
447
  * Converts a quantity in degrees to radians.
@@ -449,7 +451,7 @@ export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY ).setParamete
449
451
  * @param {Node | number} x - The input in degrees.
450
452
  * @returns {Node}
451
453
  */
452
- export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS ).setParameterLength( 1 );
454
+ export const radians = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.RADIANS ).setParameterLength( 1 );
453
455
 
454
456
  /**
455
457
  * Convert a quantity in radians to degrees.
@@ -459,7 +461,7 @@ export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS ).set
459
461
  * @param {Node | number} x - The input in radians.
460
462
  * @returns {Node}
461
463
  */
462
- export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES ).setParameterLength( 1 );
464
+ export const degrees = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DEGREES ).setParameterLength( 1 );
463
465
 
464
466
  /**
465
467
  * Returns the natural exponentiation of the parameter.
@@ -469,7 +471,7 @@ export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES ).set
469
471
  * @param {Node | number} x - The parameter.
470
472
  * @returns {Node}
471
473
  */
472
- export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP ).setParameterLength( 1 );
474
+ export const exp = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.EXP ).setParameterLength( 1 );
473
475
 
474
476
  /**
475
477
  * Returns 2 raised to the power of the parameter.
@@ -479,7 +481,7 @@ export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP ).setParamete
479
481
  * @param {Node | number} x - The parameter.
480
482
  * @returns {Node}
481
483
  */
482
- export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 ).setParameterLength( 1 );
484
+ export const exp2 = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.EXP2 ).setParameterLength( 1 );
483
485
 
484
486
  /**
485
487
  * Returns the natural logarithm of the parameter.
@@ -489,7 +491,7 @@ export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 ).setParame
489
491
  * @param {Node | number} x - The parameter.
490
492
  * @returns {Node}
491
493
  */
492
- export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG ).setParameterLength( 1 );
494
+ export const log = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.LOG ).setParameterLength( 1 );
493
495
 
494
496
  /**
495
497
  * Returns the base 2 logarithm of the parameter.
@@ -499,7 +501,7 @@ export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG ).setParamete
499
501
  * @param {Node | number} x - The parameter.
500
502
  * @returns {Node}
501
503
  */
502
- export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 ).setParameterLength( 1 );
504
+ export const log2 = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.LOG2 ).setParameterLength( 1 );
503
505
 
504
506
  /**
505
507
  * Returns the square root of the parameter.
@@ -509,7 +511,7 @@ export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 ).setParame
509
511
  * @param {Node | number} x - The parameter.
510
512
  * @returns {Node}
511
513
  */
512
- export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT ).setParameterLength( 1 );
514
+ export const sqrt = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.SQRT ).setParameterLength( 1 );
513
515
 
514
516
  /**
515
517
  * Returns the inverse of the square root of the parameter.
@@ -519,7 +521,7 @@ export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT ).setParame
519
521
  * @param {Node | number} x - The parameter.
520
522
  * @returns {Node}
521
523
  */
522
- export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_SQRT ).setParameterLength( 1 );
524
+ export const inverseSqrt = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.INVERSE_SQRT ).setParameterLength( 1 );
523
525
 
524
526
  /**
525
527
  * Finds the nearest integer less than or equal to the parameter.
@@ -529,7 +531,7 @@ export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_S
529
531
  * @param {Node | number} x - The parameter.
530
532
  * @returns {Node}
531
533
  */
532
- export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR ).setParameterLength( 1 );
534
+ export const floor = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.FLOOR ).setParameterLength( 1 );
533
535
 
534
536
  /**
535
537
  * Finds the nearest integer that is greater than or equal to the parameter.
@@ -539,7 +541,7 @@ export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR ).setPara
539
541
  * @param {Node | number} x - The parameter.
540
542
  * @returns {Node}
541
543
  */
542
- export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL ).setParameterLength( 1 );
544
+ export const ceil = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.CEIL ).setParameterLength( 1 );
543
545
 
544
546
  /**
545
547
  * Calculates the unit vector in the same direction as the original vector.
@@ -549,7 +551,7 @@ export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL ).setParame
549
551
  * @param {Node} x - The input vector.
550
552
  * @returns {Node}
551
553
  */
552
- export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE ).setParameterLength( 1 );
554
+ export const normalize = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.NORMALIZE ).setParameterLength( 1 );
553
555
 
554
556
  /**
555
557
  * Computes the fractional part of the parameter.
@@ -559,7 +561,7 @@ export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE )
559
561
  * @param {Node | number} x - The parameter.
560
562
  * @returns {Node}
561
563
  */
562
- export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT ).setParameterLength( 1 );
564
+ export const fract = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.FRACT ).setParameterLength( 1 );
563
565
 
564
566
  /**
565
567
  * Returns the sine of the parameter.
@@ -569,7 +571,7 @@ export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT ).setPara
569
571
  * @param {Node | number} x - The parameter.
570
572
  * @returns {Node}
571
573
  */
572
- export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN ).setParameterLength( 1 );
574
+ export const sin = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.SIN ).setParameterLength( 1 );
573
575
 
574
576
  /**
575
577
  * Returns the cosine of the parameter.
@@ -579,7 +581,7 @@ export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN ).setParamete
579
581
  * @param {Node | number} x - The parameter.
580
582
  * @returns {Node}
581
583
  */
582
- export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS ).setParameterLength( 1 );
584
+ export const cos = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.COS ).setParameterLength( 1 );
583
585
 
584
586
  /**
585
587
  * Returns the tangent of the parameter.
@@ -589,7 +591,7 @@ export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS ).setParamete
589
591
  * @param {Node | number} x - The parameter.
590
592
  * @returns {Node}
591
593
  */
592
- export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN ).setParameterLength( 1 );
594
+ export const tan = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.TAN ).setParameterLength( 1 );
593
595
 
594
596
  /**
595
597
  * Returns the arcsine of the parameter.
@@ -599,7 +601,7 @@ export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN ).setParamete
599
601
  * @param {Node | number} x - The parameter.
600
602
  * @returns {Node}
601
603
  */
602
- export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN ).setParameterLength( 1 );
604
+ export const asin = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ASIN ).setParameterLength( 1 );
603
605
 
604
606
  /**
605
607
  * Returns the arccosine of the parameter.
@@ -609,7 +611,7 @@ export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN ).setParame
609
611
  * @param {Node | number} x - The parameter.
610
612
  * @returns {Node}
611
613
  */
612
- export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS ).setParameterLength( 1 );
614
+ export const acos = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ACOS ).setParameterLength( 1 );
613
615
 
614
616
  /**
615
617
  * Returns the arc-tangent of the parameter.
@@ -621,7 +623,7 @@ export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS ).setParame
621
623
  * @param {?(Node | number)} x - The x parameter.
622
624
  * @returns {Node}
623
625
  */
624
- export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN ).setParameterLength( 1, 2 );
626
+ export const atan = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ATAN ).setParameterLength( 1, 2 );
625
627
 
626
628
  /**
627
629
  * Returns the absolute value of the parameter.
@@ -631,7 +633,7 @@ export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN ).setParame
631
633
  * @param {Node | number} x - The parameter.
632
634
  * @returns {Node}
633
635
  */
634
- export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS ).setParameterLength( 1 );
636
+ export const abs = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ABS ).setParameterLength( 1 );
635
637
 
636
638
  /**
637
639
  * Extracts the sign of the parameter.
@@ -641,7 +643,7 @@ export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS ).setParamete
641
643
  * @param {Node | number} x - The parameter.
642
644
  * @returns {Node}
643
645
  */
644
- export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN ).setParameterLength( 1 );
646
+ export const sign = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.SIGN ).setParameterLength( 1 );
645
647
 
646
648
  /**
647
649
  * Calculates the length of a vector.
@@ -651,7 +653,7 @@ export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN ).setParame
651
653
  * @param {Node} x - The parameter.
652
654
  * @returns {Node<float>}
653
655
  */
654
- export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH ).setParameterLength( 1 );
656
+ export const length = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.LENGTH ).setParameterLength( 1 );
655
657
 
656
658
  /**
657
659
  * Negates the value of the parameter (-x).
@@ -661,7 +663,7 @@ export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH ).setPa
661
663
  * @param {Node | number} x - The parameter.
662
664
  * @returns {Node}
663
665
  */
664
- export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE ).setParameterLength( 1 );
666
+ export const negate = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.NEGATE ).setParameterLength( 1 );
665
667
 
666
668
  /**
667
669
  * Return `1` minus the parameter.
@@ -671,7 +673,7 @@ export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE ).setPa
671
673
  * @param {Node | number} x - The parameter.
672
674
  * @returns {Node}
673
675
  */
674
- export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS ).setParameterLength( 1 );
676
+ export const oneMinus = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ONE_MINUS ).setParameterLength( 1 );
675
677
 
676
678
  /**
677
679
  * Returns the partial derivative of the parameter with respect to x.
@@ -681,7 +683,7 @@ export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS ).
681
683
  * @param {Node | number} x - The parameter.
682
684
  * @returns {Node}
683
685
  */
684
- export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX ).setParameterLength( 1 );
686
+ export const dFdx = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DFDX ).setParameterLength( 1 );
685
687
 
686
688
  /**
687
689
  * Returns the partial derivative of the parameter with respect to y.
@@ -691,7 +693,7 @@ export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX ).setParame
691
693
  * @param {Node | number} x - The parameter.
692
694
  * @returns {Node}
693
695
  */
694
- export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY ).setParameterLength( 1 );
696
+ export const dFdy = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DFDY ).setParameterLength( 1 );
695
697
 
696
698
  /**
697
699
  * Rounds the parameter to the nearest integer.
@@ -701,7 +703,7 @@ export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY ).setParame
701
703
  * @param {Node | number} x - The parameter.
702
704
  * @returns {Node}
703
705
  */
704
- export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND ).setParameterLength( 1 );
706
+ export const round = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.ROUND ).setParameterLength( 1 );
705
707
 
706
708
  /**
707
709
  * Returns the reciprocal of the parameter `(1/x)`.
@@ -711,7 +713,7 @@ export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND ).setPara
711
713
  * @param {Node | number} x - The parameter.
712
714
  * @returns {Node}
713
715
  */
714
- export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL ).setParameterLength( 1 );
716
+ export const reciprocal = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.RECIPROCAL ).setParameterLength( 1 );
715
717
 
716
718
  /**
717
719
  * Truncates the parameter, removing the fractional part.
@@ -721,7 +723,7 @@ export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL
721
723
  * @param {Node | number} x - The parameter.
722
724
  * @returns {Node}
723
725
  */
724
- export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC ).setParameterLength( 1 );
726
+ export const trunc = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.TRUNC ).setParameterLength( 1 );
725
727
 
726
728
  /**
727
729
  * Returns the sum of the absolute derivatives in x and y.
@@ -731,7 +733,7 @@ export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC ).setPara
731
733
  * @param {Node | number} x - The parameter.
732
734
  * @returns {Node}
733
735
  */
734
- export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH ).setParameterLength( 1 );
736
+ export const fwidth = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.FWIDTH ).setParameterLength( 1 );
735
737
 
736
738
  /**
737
739
  * Returns the transpose of a matrix.
@@ -741,7 +743,27 @@ export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH ).setPa
741
743
  * @param {Node<mat2|mat3|mat4>} x - The parameter.
742
744
  * @returns {Node}
743
745
  */
744
- export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE ).setParameterLength( 1 );
746
+ export const transpose = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.TRANSPOSE ).setParameterLength( 1 );
747
+
748
+ /**
749
+ * Returns the determinant of a matrix.
750
+ *
751
+ * @tsl
752
+ * @function
753
+ * @param {Node<mat2|mat3|mat4>} x - The parameter.
754
+ * @returns {Node<float>}
755
+ */
756
+ export const determinant = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DETERMINANT ).setParameterLength( 1 );
757
+
758
+ /**
759
+ * Returns the inverse of a matrix.
760
+ *
761
+ * @tsl
762
+ * @function
763
+ * @param {Node<mat2|mat3|mat4>} x - The parameter.
764
+ * @returns {Node<mat2|mat3|mat4>}
765
+ */
766
+ export const inverse = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.INVERSE ).setParameterLength( 1 );
745
767
 
746
768
  // 2 inputs
747
769
 
@@ -754,7 +776,7 @@ export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE )
754
776
  * @param {string} y - The new type.
755
777
  * @returns {Node}
756
778
  */
757
- export const bitcast = /*@__PURE__*/ nodeProxy( MathNode, MathNode.BITCAST ).setParameterLength( 2 );
779
+ export const bitcast = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.BITCAST ).setParameterLength( 2 );
758
780
 
759
781
  /**
760
782
  * Returns `true` if `x` equals `y`.
@@ -781,7 +803,7 @@ export const equals = ( x, y ) => { // @deprecated, r172
781
803
  * @param {...(Node | number)} values - The values to compare.
782
804
  * @returns {Node}
783
805
  */
784
- export const min = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIN ).setParameterLength( 2, Infinity );
806
+ export const min = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.MIN ).setParameterLength( 2, Infinity );
785
807
 
786
808
  /**
787
809
  * Returns the greatest of the given values.
@@ -791,7 +813,7 @@ export const min = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIN ).setParamete
791
813
  * @param {...(Node | number)} values - The values to compare.
792
814
  * @returns {Node}
793
815
  */
794
- export const max = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MAX ).setParameterLength( 2, Infinity );
816
+ export const max = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.MAX ).setParameterLength( 2, Infinity );
795
817
 
796
818
  /**
797
819
  * Generate a step function by comparing two values.
@@ -802,7 +824,7 @@ export const max = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MAX ).setParamete
802
824
  * @param {Node | number} y - The x parameter.
803
825
  * @returns {Node}
804
826
  */
805
- export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP ).setParameterLength( 2 );
827
+ export const step = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.STEP ).setParameterLength( 2 );
806
828
 
807
829
  /**
808
830
  * Calculates the reflection direction for an incident vector.
@@ -813,7 +835,7 @@ export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP ).setParame
813
835
  * @param {Node<vec2|vec3|vec4>} N - The normal vector.
814
836
  * @returns {Node<vec2|vec3|vec4>}
815
837
  */
816
- export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT ).setParameterLength( 2 );
838
+ export const reflect = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.REFLECT ).setParameterLength( 2 );
817
839
 
818
840
  /**
819
841
  * Calculates the distance between two points.
@@ -824,7 +846,7 @@ export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT ).set
824
846
  * @param {Node<vec2|vec3|vec4>} y - The second point.
825
847
  * @returns {Node<float>}
826
848
  */
827
- export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE ).setParameterLength( 2 );
849
+ export const distance = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DISTANCE ).setParameterLength( 2 );
828
850
 
829
851
  /**
830
852
  * Calculates the absolute difference between two values.
@@ -835,7 +857,7 @@ export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE ).s
835
857
  * @param {Node | number} y - The second parameter.
836
858
  * @returns {Node}
837
859
  */
838
- export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE ).setParameterLength( 2 );
860
+ export const difference = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DIFFERENCE ).setParameterLength( 2 );
839
861
 
840
862
  /**
841
863
  * Calculates the dot product of two vectors.
@@ -846,18 +868,18 @@ export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE
846
868
  * @param {Node<vec2|vec3|vec4>} y - The second vector.
847
869
  * @returns {Node<float>}
848
870
  */
849
- export const dot = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DOT ).setParameterLength( 2 );
871
+ export const dot = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.DOT ).setParameterLength( 2 );
850
872
 
851
873
  /**
852
874
  * Calculates the cross product of two vectors.
853
875
  *
854
876
  * @tsl
855
877
  * @function
856
- * @param {Node<vec2|vec3|vec4>} x - The first vector.
857
- * @param {Node<vec2|vec3|vec4>} y - The second vector.
858
- * @returns {Node<vec2|vec3|vec4>}
878
+ * @param {Node<vec2|vec3>} x - The first vector.
879
+ * @param {Node<vec2|vec3>} y - The second vector.
880
+ * @returns {Node<float|vec3>}
859
881
  */
860
- export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS ).setParameterLength( 2 );
882
+ export const cross = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.CROSS ).setParameterLength( 2 );
861
883
 
862
884
  /**
863
885
  * Return the value of the first parameter raised to the power of the second one.
@@ -868,7 +890,7 @@ export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS ).setPara
868
890
  * @param {Node | number} y - The second parameter.
869
891
  * @returns {Node}
870
892
  */
871
- export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW ).setParameterLength( 2 );
893
+ export const pow = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.POW ).setParameterLength( 2 );
872
894
 
873
895
  /**
874
896
  * Returns the square of the parameter.
@@ -878,7 +900,7 @@ export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW ).setParamete
878
900
  * @param {Node | number} x - The first parameter.
879
901
  * @returns {Node}
880
902
  */
881
- export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 ).setParameterLength( 1 );
903
+ export const pow2 = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.POW, 2 ).setParameterLength( 1 );
882
904
 
883
905
  /**
884
906
  * Returns the cube of the parameter.
@@ -888,7 +910,7 @@ export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 ).setPara
888
910
  * @param {Node | number} x - The first parameter.
889
911
  * @returns {Node}
890
912
  */
891
- export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 ).setParameterLength( 1 );
913
+ export const pow3 = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.POW, 3 ).setParameterLength( 1 );
892
914
 
893
915
  /**
894
916
  * Returns the fourth power of the parameter.
@@ -898,7 +920,7 @@ export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 ).setPara
898
920
  * @param {Node | number} x - The first parameter.
899
921
  * @returns {Node}
900
922
  */
901
- export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 ).setParameterLength( 1 );
923
+ export const pow4 = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.POW, 4 ).setParameterLength( 1 );
902
924
 
903
925
  /**
904
926
  * Transforms the direction of a vector by a matrix and then normalizes the result.
@@ -909,7 +931,7 @@ export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 ).setPara
909
931
  * @param {Node<mat2|mat3|mat4>} matrix - The transformation matrix.
910
932
  * @returns {Node}
911
933
  */
912
- export const transformDirection = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION ).setParameterLength( 2 );
934
+ export const transformDirection = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.TRANSFORM_DIRECTION ).setParameterLength( 2 );
913
935
 
914
936
  /**
915
937
  * Returns the cube root of a number.
@@ -941,7 +963,7 @@ export const lengthSq = ( a ) => dot( a, a );
941
963
  * @param {Node | number} t - The interpolation value.
942
964
  * @returns {Node}
943
965
  */
944
- export const mix = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIX ).setParameterLength( 3 );
966
+ export const mix = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.MIX ).setParameterLength( 3 );
945
967
 
946
968
  /**
947
969
  * Constrains a value to lie between two further values.
@@ -975,7 +997,7 @@ export const saturate = ( value ) => clamp( value );
975
997
  * @param {Node<float>} eta - The ratio of indices of refraction.
976
998
  * @returns {Node<vec2|vec3|vec4>}
977
999
  */
978
- export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT ).setParameterLength( 3 );
1000
+ export const refract = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.REFRACT ).setParameterLength( 3 );
979
1001
 
980
1002
  /**
981
1003
  * Performs a Hermite interpolation between two values.
@@ -987,7 +1009,7 @@ export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT ).set
987
1009
  * @param {Node | number} x - The source value for interpolation.
988
1010
  * @returns {Node}
989
1011
  */
990
- export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP ).setParameterLength( 3 );
1012
+ export const smoothstep = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.SMOOTHSTEP ).setParameterLength( 3 );
991
1013
 
992
1014
  /**
993
1015
  * Returns a vector pointing in the same direction as another.
@@ -999,7 +1021,7 @@ export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP
999
1021
  * @param {Node<vec2|vec3|vec4>} Nref - The reference vector.
1000
1022
  * @returns {Node<vec2|vec3|vec4>}
1001
1023
  */
1002
- export const faceForward = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FACEFORWARD ).setParameterLength( 3 );
1024
+ export const faceForward = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.FACEFORWARD ).setParameterLength( 3 );
1003
1025
 
1004
1026
  /**
1005
1027
  * Returns a random value for the given uv.
@@ -1134,4 +1156,6 @@ addMethodChaining( 'difference', difference );
1134
1156
  addMethodChaining( 'saturate', saturate );
1135
1157
  addMethodChaining( 'cbrt', cbrt );
1136
1158
  addMethodChaining( 'transpose', transpose );
1159
+ addMethodChaining( 'determinant', determinant );
1160
+ addMethodChaining( 'inverse', inverse );
1137
1161
  addMethodChaining( 'rand', rand );