super-three 0.177.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 (211) hide show
  1. package/README.md +1 -1
  2. package/build/three.cjs +959 -231
  3. package/build/three.core.js +751 -170
  4. package/build/three.core.min.js +1 -1
  5. package/build/three.module.js +210 -64
  6. package/build/three.module.min.js +1 -1
  7. package/build/three.tsl.js +78 -29
  8. package/build/three.tsl.min.js +1 -1
  9. package/build/three.webgpu.js +3269 -1545
  10. package/build/three.webgpu.min.js +1 -1
  11. package/build/three.webgpu.nodes.js +3093 -1545
  12. package/build/three.webgpu.nodes.min.js +1 -1
  13. package/examples/jsm/Addons.js +1 -2
  14. package/examples/jsm/capabilities/WebGL.js +0 -27
  15. package/examples/jsm/capabilities/WebGPU.js +1 -1
  16. package/examples/jsm/controls/ArcballControls.js +1 -1
  17. package/examples/jsm/controls/TransformControls.js +61 -14
  18. package/examples/jsm/csm/CSMShadowNode.js +4 -4
  19. package/examples/jsm/environments/RoomEnvironment.js +8 -3
  20. package/examples/jsm/exporters/USDZExporter.js +676 -299
  21. package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
  22. package/examples/jsm/interactive/HTMLMesh.js +5 -3
  23. package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
  24. package/examples/jsm/lights/LightProbeGenerator.js +14 -3
  25. package/examples/jsm/loaders/ColladaLoader.js +1 -1
  26. package/examples/jsm/loaders/EXRLoader.js +210 -22
  27. package/examples/jsm/loaders/FBXLoader.js +2 -2
  28. package/examples/jsm/loaders/MaterialXLoader.js +212 -30
  29. package/examples/jsm/loaders/TTFLoader.js +13 -1
  30. package/examples/jsm/loaders/USDLoader.js +219 -0
  31. package/examples/jsm/loaders/USDZLoader.js +4 -892
  32. package/examples/jsm/loaders/usd/USDAParser.js +741 -0
  33. package/examples/jsm/loaders/usd/USDCParser.js +17 -0
  34. package/examples/jsm/objects/LensflareMesh.js +3 -3
  35. package/examples/jsm/objects/SkyMesh.js +2 -2
  36. package/examples/jsm/physics/RapierPhysics.js +95 -16
  37. package/examples/jsm/postprocessing/GTAOPass.js +10 -9
  38. package/examples/jsm/postprocessing/OutlinePass.js +17 -17
  39. package/examples/jsm/postprocessing/SSAOPass.js +10 -9
  40. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
  41. package/examples/jsm/transpiler/AST.js +381 -30
  42. package/examples/jsm/transpiler/GLSLDecoder.js +226 -86
  43. package/examples/jsm/transpiler/Linker.js +327 -0
  44. package/examples/jsm/transpiler/TSLEncoder.js +197 -92
  45. package/examples/jsm/transpiler/Transpiler.js +17 -1
  46. package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
  47. package/examples/jsm/transpiler/WGSLEncoder.js +788 -0
  48. package/examples/jsm/tsl/display/BloomNode.js +8 -7
  49. package/examples/jsm/tsl/display/ChromaticAberrationNode.js +206 -0
  50. package/examples/jsm/tsl/display/GaussianBlurNode.js +8 -10
  51. package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
  52. package/examples/jsm/tsl/display/{TRAAPassNode.js → TRAANode.js} +181 -172
  53. package/examples/jsm/tsl/display/hashBlur.js +3 -3
  54. package/examples/jsm/tsl/lighting/TiledLightsNode.js +1 -1
  55. package/package.json +1 -1
  56. package/src/Three.Core.js +1 -0
  57. package/src/Three.TSL.js +77 -28
  58. package/src/Three.WebGPU.js +2 -0
  59. package/src/animation/KeyframeTrack.js +1 -1
  60. package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
  61. package/src/animation/tracks/StringKeyframeTrack.js +1 -1
  62. package/src/cameras/Camera.js +14 -0
  63. package/src/cameras/OrthographicCamera.js +1 -1
  64. package/src/cameras/PerspectiveCamera.js +1 -1
  65. package/src/constants.js +3 -3
  66. package/src/core/BufferAttribute.js +3 -3
  67. package/src/core/Clock.js +2 -8
  68. package/src/core/GLBufferAttribute.js +13 -1
  69. package/src/core/Object3D.js +1 -1
  70. package/{examples/jsm/misc → src/core}/Timer.js +4 -42
  71. package/src/extras/PMREMGenerator.js +11 -0
  72. package/src/extras/core/Path.js +22 -22
  73. package/src/helpers/CameraHelper.js +41 -11
  74. package/src/helpers/SkeletonHelper.js +35 -6
  75. package/src/lights/LightShadow.js +21 -8
  76. package/src/lights/PointLightShadow.js +1 -1
  77. package/src/loaders/FileLoader.js +27 -4
  78. package/src/loaders/ImageBitmapLoader.js +27 -4
  79. package/src/loaders/ImageLoader.js +55 -8
  80. package/src/loaders/Loader.js +14 -0
  81. package/src/loaders/LoadingManager.js +23 -0
  82. package/src/materials/MeshBasicMaterial.js +1 -1
  83. package/src/materials/nodes/Line2NodeMaterial.js +0 -8
  84. package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
  85. package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
  86. package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
  87. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
  88. package/src/materials/nodes/MeshSSSNodeMaterial.js +2 -2
  89. package/src/materials/nodes/NodeMaterial.js +28 -5
  90. package/src/materials/nodes/PointsNodeMaterial.js +5 -0
  91. package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -2
  92. package/src/math/Frustum.js +25 -9
  93. package/src/math/FrustumArray.js +10 -5
  94. package/src/math/Line3.js +129 -2
  95. package/src/math/Matrix4.js +48 -27
  96. package/src/math/Quaternion.js +1 -1
  97. package/src/math/Spherical.js +2 -2
  98. package/src/nodes/Nodes.js +2 -3
  99. package/src/nodes/TSL.js +5 -3
  100. package/src/nodes/accessors/AccessorsUtils.js +7 -8
  101. package/src/nodes/accessors/Bitangent.js +31 -25
  102. package/src/nodes/accessors/Camera.js +12 -12
  103. package/src/nodes/accessors/Normal.js +95 -29
  104. package/src/nodes/accessors/Object3DNode.js +1 -1
  105. package/src/nodes/accessors/Position.js +7 -7
  106. package/src/nodes/accessors/ReferenceNode.js +18 -3
  107. package/src/nodes/accessors/ReflectVector.js +3 -3
  108. package/src/nodes/accessors/SceneNode.js +1 -1
  109. package/src/nodes/accessors/StorageTextureNode.js +1 -1
  110. package/src/nodes/accessors/Tangent.js +25 -17
  111. package/src/nodes/accessors/TangentUtils.js +46 -0
  112. package/src/nodes/accessors/TextureBicubic.js +21 -3
  113. package/src/nodes/accessors/TextureNode.js +12 -0
  114. package/src/nodes/accessors/UniformArrayNode.js +0 -16
  115. package/src/nodes/core/ArrayNode.js +12 -0
  116. package/src/nodes/core/AssignNode.js +3 -0
  117. package/src/nodes/core/CacheNode.js +0 -14
  118. package/src/nodes/core/ContextNode.js +20 -1
  119. package/src/nodes/core/Node.js +15 -3
  120. package/src/nodes/core/NodeBuilder.js +228 -92
  121. package/src/nodes/core/NodeUtils.js +4 -1
  122. package/src/nodes/core/StackNode.js +49 -29
  123. package/src/nodes/core/SubBuildNode.js +89 -0
  124. package/src/nodes/core/UniformNode.js +63 -5
  125. package/src/nodes/core/VarNode.js +91 -2
  126. package/src/nodes/core/VaryingNode.js +6 -4
  127. package/src/nodes/display/BlendModes.js +2 -2
  128. package/src/nodes/display/FrontFacingNode.js +34 -2
  129. package/src/nodes/display/NormalMapNode.js +19 -50
  130. package/src/nodes/display/PassNode.js +157 -9
  131. package/src/nodes/display/ScreenNode.js +0 -26
  132. package/src/nodes/display/ViewportTextureNode.js +67 -7
  133. package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
  134. package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
  135. package/src/nodes/functions/PhongLightingModel.js +3 -3
  136. package/src/nodes/functions/PhysicalLightingModel.js +16 -16
  137. package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
  138. package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
  139. package/src/nodes/gpgpu/ComputeNode.js +67 -23
  140. package/src/nodes/gpgpu/WorkgroupInfoNode.js +28 -3
  141. package/src/nodes/lighting/EnvironmentNode.js +5 -5
  142. package/src/nodes/lighting/LightsNode.js +4 -4
  143. package/src/nodes/lighting/ProjectorLightNode.js +19 -6
  144. package/src/nodes/lighting/ShadowFilterNode.js +1 -1
  145. package/src/nodes/lighting/ShadowNode.js +2 -2
  146. package/src/nodes/materialx/MaterialXNodes.js +131 -2
  147. package/src/nodes/materialx/lib/mx_noise.js +165 -1
  148. package/src/nodes/math/ConditionalNode.js +1 -20
  149. package/src/nodes/math/MathNode.js +90 -55
  150. package/src/nodes/math/OperatorNode.js +22 -39
  151. package/src/nodes/tsl/TSLBase.js +1 -0
  152. package/src/nodes/tsl/TSLCore.js +114 -55
  153. package/src/nodes/utils/DebugNode.js +1 -1
  154. package/src/nodes/utils/EquirectUV.js +27 -0
  155. package/src/nodes/utils/EventNode.js +83 -0
  156. package/src/nodes/utils/LoopNode.js +0 -17
  157. package/src/nodes/utils/MatcapUV.js +22 -0
  158. package/src/nodes/utils/RTTNode.js +22 -5
  159. package/src/nodes/utils/ReflectorNode.js +11 -4
  160. package/src/nodes/utils/SampleNode.js +81 -0
  161. package/src/nodes/utils/TriplanarTextures.js +65 -0
  162. package/src/objects/BatchedMesh.js +4 -2
  163. package/src/renderers/WebGLRenderer.js +26 -24
  164. package/src/renderers/common/Background.js +2 -2
  165. package/src/renderers/common/Bindings.js +19 -18
  166. package/src/renderers/common/Color4.js +2 -2
  167. package/src/renderers/common/CubeRenderTarget.js +1 -1
  168. package/src/renderers/common/PostProcessing.js +60 -5
  169. package/src/renderers/common/RenderObject.js +68 -3
  170. package/src/renderers/common/Renderer.js +19 -16
  171. package/src/renderers/common/SampledTexture.js +3 -71
  172. package/src/renderers/common/Sampler.js +79 -0
  173. package/src/renderers/common/Storage3DTexture.js +100 -0
  174. package/src/renderers/common/StorageArrayTexture.js +84 -0
  175. package/src/renderers/common/StorageTexture.js +19 -0
  176. package/src/renderers/common/Textures.js +19 -3
  177. package/src/renderers/common/XRManager.js +31 -12
  178. package/src/renderers/common/XRRenderTarget.js +21 -4
  179. package/src/renderers/common/extras/PMREMGenerator.js +1 -1
  180. package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
  181. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +20 -2
  182. package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
  183. package/src/renderers/webgl/WebGLAttributes.js +4 -0
  184. package/src/renderers/webgl/WebGLCapabilities.js +2 -2
  185. package/src/renderers/webgl/WebGLProgram.js +12 -6
  186. package/src/renderers/webgl/WebGLPrograms.js +6 -4
  187. package/src/renderers/webgl/WebGLShadowMap.js +11 -1
  188. package/src/renderers/webgl/WebGLState.js +4 -4
  189. package/src/renderers/webgl/WebGLTextures.js +19 -7
  190. package/src/renderers/webgl-fallback/WebGLBackend.js +103 -72
  191. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +3 -5
  192. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
  193. package/src/renderers/webgl-fallback/utils/WebGLState.js +4 -4
  194. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +2 -0
  195. package/src/renderers/webgpu/WebGPUBackend.js +63 -16
  196. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +64 -79
  197. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -0
  198. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -31
  199. package/src/renderers/webgpu/utils/WebGPUConstants.js +7 -1
  200. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +5 -5
  201. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +12 -65
  202. package/src/renderers/webgpu/utils/WebGPUUtils.js +2 -17
  203. package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
  204. package/src/renderers/webxr/WebXRManager.js +68 -6
  205. package/src/textures/ExternalTexture.js +45 -0
  206. package/src/textures/FramebufferTexture.js +2 -2
  207. package/src/textures/Source.js +11 -1
  208. package/src/textures/VideoTexture.js +30 -2
  209. package/src/nodes/utils/EquirectUVNode.js +0 -65
  210. package/src/nodes/utils/MatcapUVNode.js +0 -49
  211. package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
@@ -1103,11 +1103,13 @@ class Matrix4 {
1103
1103
  * @param {number} near - The distance from the camera to the near plane.
1104
1104
  * @param {number} far - The distance from the camera to the far plane.
1105
1105
  * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
1106
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
1106
1107
  * @return {Matrix4} A reference to this matrix.
1107
1108
  */
1108
- makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
1109
+ makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
1109
1110
 
1110
1111
  const te = this.elements;
1112
+
1111
1113
  const x = 2 * near / ( right - left );
1112
1114
  const y = 2 * near / ( top - bottom );
1113
1115
 
@@ -1116,19 +1118,28 @@ class Matrix4 {
1116
1118
 
1117
1119
  let c, d;
1118
1120
 
1119
- if ( coordinateSystem === WebGLCoordinateSystem ) {
1121
+ if ( reversedDepth ) {
1120
1122
 
1121
- c = - ( far + near ) / ( far - near );
1122
- d = ( - 2 * far * near ) / ( far - near );
1123
+ c = near / ( far - near );
1124
+ d = ( far * near ) / ( far - near );
1123
1125
 
1124
- } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
1126
+ } else {
1125
1127
 
1126
- c = - far / ( far - near );
1127
- d = ( - far * near ) / ( far - near );
1128
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
1128
1129
 
1129
- } else {
1130
+ c = - ( far + near ) / ( far - near );
1131
+ d = ( - 2 * far * near ) / ( far - near );
1132
+
1133
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
1134
+
1135
+ c = - far / ( far - near );
1136
+ d = ( - far * near ) / ( far - near );
1130
1137
 
1131
- throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
1138
+ } else {
1139
+
1140
+ throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
1141
+
1142
+ }
1132
1143
 
1133
1144
  }
1134
1145
 
@@ -1152,39 +1163,49 @@ class Matrix4 {
1152
1163
  * @param {number} near - The distance from the camera to the near plane.
1153
1164
  * @param {number} far - The distance from the camera to the far plane.
1154
1165
  * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
1166
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
1155
1167
  * @return {Matrix4} A reference to this matrix.
1156
1168
  */
1157
- makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
1169
+ makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
1158
1170
 
1159
1171
  const te = this.elements;
1160
- const w = 1.0 / ( right - left );
1161
- const h = 1.0 / ( top - bottom );
1162
- const p = 1.0 / ( far - near );
1163
-
1164
- const x = ( right + left ) * w;
1165
- const y = ( top + bottom ) * h;
1166
1172
 
1167
- let z, zInv;
1173
+ const x = 2 / ( right - left );
1174
+ const y = 2 / ( top - bottom );
1168
1175
 
1169
- if ( coordinateSystem === WebGLCoordinateSystem ) {
1176
+ const a = - ( right + left ) / ( right - left );
1177
+ const b = - ( top + bottom ) / ( top - bottom );
1170
1178
 
1171
- z = ( far + near ) * p;
1172
- zInv = - 2 * p;
1179
+ let c, d;
1173
1180
 
1174
- } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
1181
+ if ( reversedDepth ) {
1175
1182
 
1176
- z = near * p;
1177
- zInv = - 1 * p;
1183
+ c = 1 / ( far - near );
1184
+ d = far / ( far - near );
1178
1185
 
1179
1186
  } else {
1180
1187
 
1181
- throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
1188
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
1189
+
1190
+ c = - 2 / ( far - near );
1191
+ d = - ( far + near ) / ( far - near );
1192
+
1193
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
1194
+
1195
+ c = - 1 / ( far - near );
1196
+ d = - near / ( far - near );
1197
+
1198
+ } else {
1199
+
1200
+ throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
1201
+
1202
+ }
1182
1203
 
1183
1204
  }
1184
1205
 
1185
- te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
1186
- te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
1187
- te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z;
1206
+ te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = a;
1207
+ te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = 0; te[ 13 ] = b;
1208
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
1188
1209
  te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
1189
1210
 
1190
1211
  return this;
@@ -482,7 +482,7 @@ class Quaternion {
482
482
 
483
483
  let r = vFrom.dot( vTo ) + 1;
484
484
 
485
- if ( r < Number.EPSILON ) {
485
+ if ( r < 1e-8 ) { // the epsilon value has been discussed in #31286
486
486
 
487
487
  // vFrom and vTo point in opposite directions
488
488
 
@@ -107,8 +107,8 @@ class Spherical {
107
107
  * Sets the spherical components from the given Cartesian coordinates.
108
108
  *
109
109
  * @param {number} x - The x value.
110
- * @param {number} y - The x value.
111
- * @param {number} z - The x value.
110
+ * @param {number} y - The y value.
111
+ * @param {number} z - The z value.
112
112
  * @return {Spherical} A reference to this spherical.
113
113
  */
114
114
  setFromCartesianCoords( x, y, z ) {
@@ -33,6 +33,7 @@ export { default as StructNode } from './core/StructNode.js';
33
33
  export { default as StructTypeNode } from './core/StructTypeNode.js';
34
34
  export { default as OutputStructNode } from './core/OutputStructNode.js';
35
35
  export { default as MRTNode } from './core/MRTNode.js';
36
+ export { default as SubBuildNode } from './core/SubBuildNode.js';
36
37
 
37
38
  import * as NodeUtils from './core/NodeUtils.js';
38
39
  export { NodeUtils };
@@ -40,11 +41,9 @@ export { NodeUtils };
40
41
  // utils
41
42
  export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
42
43
  export { default as ConvertNode } from './utils/ConvertNode.js';
43
- export { default as EquirectUVNode } from './utils/EquirectUVNode.js';
44
44
  export { default as FunctionOverloadingNode } from './utils/FunctionOverloadingNode.js';
45
45
  export { default as JoinNode } from './utils/JoinNode.js';
46
46
  export { default as LoopNode } from './utils/LoopNode.js';
47
- export { default as MatcapUVNode } from './utils/MatcapUVNode.js';
48
47
  export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js';
49
48
  export { default as RemapNode } from './utils/RemapNode.js';
50
49
  export { default as RotateNode } from './utils/RotateNode.js';
@@ -52,11 +51,11 @@ export { default as SetNode } from './utils/SetNode.js';
52
51
  export { default as SplitNode } from './utils/SplitNode.js';
53
52
  export { default as SpriteSheetUVNode } from './utils/SpriteSheetUVNode.js';
54
53
  export { default as StorageArrayElementNode } from './utils/StorageArrayElementNode.js';
55
- export { default as TriplanarTexturesNode } from './utils/TriplanarTexturesNode.js';
56
54
  export { default as ReflectorNode } from './utils/ReflectorNode.js';
57
55
  export { default as RTTNode } from './utils/RTTNode.js';
58
56
  export { default as MemberNode } from './utils/MemberNode.js';
59
57
  export { default as DebugNode } from './utils/DebugNode.js';
58
+ export { default as EventNode } from './utils/EventNode.js';
60
59
 
61
60
  // accessors
62
61
  export { default as UniformArrayNode } from './accessors/UniformArrayNode.js';
package/src/nodes/TSL.js CHANGED
@@ -24,10 +24,10 @@ export * from './math/MathUtils.js';
24
24
  export * from './math/TriNoise3D.js';
25
25
 
26
26
  // utils
27
- export * from './utils/EquirectUVNode.js';
27
+ export * from './utils/EquirectUV.js';
28
28
  export * from './utils/FunctionOverloadingNode.js';
29
29
  export * from './utils/LoopNode.js';
30
- export * from './utils/MatcapUVNode.js';
30
+ export * from './utils/MatcapUV.js';
31
31
  export * from './utils/MaxMipLevelNode.js';
32
32
  export * from './utils/Oscillators.js';
33
33
  export * from './utils/Packing.js';
@@ -38,10 +38,12 @@ export * from './utils/ViewportUtils.js';
38
38
  export * from './utils/RotateNode.js';
39
39
  export * from './utils/SpriteSheetUVNode.js';
40
40
  export * from './utils/Timer.js';
41
- export * from './utils/TriplanarTexturesNode.js';
41
+ export * from './utils/TriplanarTextures.js';
42
42
  export * from './utils/ReflectorNode.js';
43
43
  export * from './utils/RTTNode.js';
44
44
  export * from './utils/PostProcessingUtils.js';
45
+ export * from './utils/SampleNode.js';
46
+ export * from './utils/EventNode.js';
45
47
 
46
48
  // three.js shading language
47
49
  export * from './tsl/TSLBase.js';
@@ -1,7 +1,7 @@
1
- import { bitangentView } from './Bitangent.js';
2
- import { normalView, transformedNormalView } from './Normal.js';
1
+ import { normalView } from './Normal.js';
3
2
  import { tangentView } from './Tangent.js';
4
- import { mat3 } from '../tsl/TSLBase.js';
3
+ import { bitangentView } from './Bitangent.js';
4
+ import { Fn, mat3 } from '../tsl/TSLBase.js';
5
5
  import { mix } from '../math/MathNode.js';
6
6
  import { anisotropy, anisotropyB, roughness } from '../core/PropertyNode.js';
7
7
  import { positionViewDirection } from './Position.js';
@@ -12,7 +12,7 @@ import { positionViewDirection } from './Position.js';
12
12
  * @tsl
13
13
  * @type {Node<mat3>}
14
14
  */
15
- export const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView );
15
+ export const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView ).toVar( 'TBNViewMatrix' );
16
16
 
17
17
  /**
18
18
  * TSL object that represents the parallax direction.
@@ -40,15 +40,14 @@ export const parallaxUV = ( uv, scale ) => uv.sub( parallaxDirection.mul( scale
40
40
  * @function
41
41
  * @returns {Node<vec3>} Bent normals.
42
42
  */
43
- export const transformedBentNormalView = /*@__PURE__*/ ( () => {
43
+ export const bentNormalView = /*@__PURE__*/ ( Fn( () => {
44
44
 
45
45
  // https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy
46
46
 
47
47
  let bentNormal = anisotropyB.cross( positionViewDirection );
48
48
  bentNormal = bentNormal.cross( anisotropyB ).normalize();
49
- bentNormal = mix( bentNormal, transformedNormalView, anisotropy.mul( roughness.oneMinus() ).oneMinus().pow2().pow2() ).normalize();
49
+ bentNormal = mix( bentNormal, normalView, anisotropy.mul( roughness.oneMinus() ).oneMinus().pow2().pow2() ).normalize();
50
50
 
51
51
  return bentNormal;
52
52
 
53
-
54
- } )();
53
+ } ).once() )();
@@ -1,8 +1,8 @@
1
- import { varying } from '../core/VaryingNode.js';
2
1
  import { Fn } from '../tsl/TSLCore.js';
3
- import { cameraViewMatrix } from './Camera.js';
4
- import { normalGeometry, normalLocal, normalView, normalWorld, transformedNormalView } from './Normal.js';
5
- import { tangentGeometry, tangentLocal, tangentView, tangentWorld, transformedTangentView } from './Tangent.js';
2
+ import { normalGeometry, normalLocal, normalView, normalWorld } from './Normal.js';
3
+ import { tangentGeometry, tangentLocal, tangentView, tangentWorld } from './Tangent.js';
4
+ import { bitangentViewFrame } from './TangentUtils.js';
5
+ import { directionToFaceDirection } from '../display/FrontFacingNode.js';
6
6
 
7
7
  /**
8
8
  * Returns the bitangent node and assigns it to a varying if the material is not flat shaded.
@@ -13,19 +13,19 @@ import { tangentGeometry, tangentLocal, tangentView, tangentWorld, transformedTa
13
13
  * @param {string} varyingName - The name of the varying to assign the bitangent to.
14
14
  * @returns {Node<vec3>} The bitangent node.
15
15
  */
16
- const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], builder ) => {
16
+ const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], { subBuildFn, material } ) => {
17
17
 
18
18
  let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
19
19
 
20
- if ( builder.material.flatShading !== true ) {
20
+ if ( subBuildFn === 'NORMAL' && material.flatShading !== true ) {
21
21
 
22
- bitangent = varying( bitangent, varyingName );
22
+ bitangent = bitangent.toVarying( varyingName );
23
23
 
24
24
  }
25
25
 
26
26
  return bitangent;
27
27
 
28
- } ).once();
28
+ } ).once( [ 'NORMAL' ] );
29
29
 
30
30
  /**
31
31
  * TSL object that represents the bitangent attribute of the current rendered object.
@@ -49,7 +49,29 @@ export const bitangentLocal = /*@__PURE__*/ getBitangent( normalLocal.cross( tan
49
49
  * @tsl
50
50
  * @type {Node<vec3>}
51
51
  */
52
- export const bitangentView = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize().toVar( 'bitangentView' );
52
+ export const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => {
53
+
54
+ let node;
55
+
56
+ if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
57
+
58
+ node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
59
+
60
+ } else {
61
+
62
+ node = bitangentViewFrame;
63
+
64
+ }
65
+
66
+ if ( material.flatShading !== true ) {
67
+
68
+ node = directionToFaceDirection( node );
69
+
70
+ }
71
+
72
+ return node;
73
+
74
+ }, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'bitangentView' );
53
75
 
54
76
  /**
55
77
  * TSL object that represents the vertex bitangent in world space of the current rendered object.
@@ -58,19 +80,3 @@ export const bitangentView = getBitangent( normalView.cross( tangentView ), 'v_b
58
80
  * @type {Node<vec3>}
59
81
  */
60
82
  export const bitangentWorld = /*@__PURE__*/ getBitangent( normalWorld.cross( tangentWorld ), 'v_bitangentWorld' ).normalize().toVar( 'bitangentWorld' );
61
-
62
- /**
63
- * TSL object that represents the transformed vertex bitangent in view space of the current rendered object.
64
- *
65
- * @tsl
66
- * @type {Node<vec3>}
67
- */
68
- export const transformedBitangentView = /*@__PURE__*/ getBitangent( transformedNormalView.cross( transformedTangentView ), 'v_transformedBitangentView' ).normalize().toVar( 'transformedBitangentView' );
69
-
70
- /**
71
- * TSL object that represents the transformed vertex bitangent in world space of the current rendered object.
72
- *
73
- * @tsl
74
- * @type {Node<vec4>}
75
- */
76
- export const transformedBitangentWorld = /*@__PURE__*/ transformedBitangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedBitangentWorld' );
@@ -11,7 +11,7 @@ import { builtin } from './BuiltinNode.js';
11
11
  * @tsl
12
12
  * @type {UniformNode<uint>}
13
13
  */
14
- export const cameraIndex = /*@__PURE__*/ uniform( 0, 'uint' ).label( 'u_cameraIndex' ).setGroup( sharedUniformGroup( 'cameraIndex' ) ).toVarying( 'v_cameraIndex' );
14
+ export const cameraIndex = /*@__PURE__*/ uniform( 0, 'uint' ).setName( 'u_cameraIndex' ).setGroup( sharedUniformGroup( 'cameraIndex' ) ).toVarying( 'v_cameraIndex' );
15
15
 
16
16
  /**
17
17
  * TSL object that represents the `near` value of the camera used for the current render.
@@ -19,7 +19,7 @@ export const cameraIndex = /*@__PURE__*/ uniform( 0, 'uint' ).label( 'u_cameraIn
19
19
  * @tsl
20
20
  * @type {UniformNode<float>}
21
21
  */
22
- export const cameraNear = /*@__PURE__*/ uniform( 'float' ).label( 'cameraNear' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.near );
22
+ export const cameraNear = /*@__PURE__*/ uniform( 'float' ).setName( 'cameraNear' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.near );
23
23
 
24
24
  /**
25
25
  * TSL object that represents the `far` value of the camera used for the current render.
@@ -27,7 +27,7 @@ export const cameraNear = /*@__PURE__*/ uniform( 'float' ).label( 'cameraNear' )
27
27
  * @tsl
28
28
  * @type {UniformNode<float>}
29
29
  */
30
- export const cameraFar = /*@__PURE__*/ uniform( 'float' ).label( 'cameraFar' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.far );
30
+ export const cameraFar = /*@__PURE__*/ uniform( 'float' ).setName( 'cameraFar' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.far );
31
31
 
32
32
  /**
33
33
  * TSL object that represents the projection matrix of the camera used for the current render.
@@ -49,13 +49,13 @@ export const cameraProjectionMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
49
49
 
50
50
  }
51
51
 
52
- const cameraProjectionMatrices = uniformArray( matrices ).setGroup( renderGroup ).label( 'cameraProjectionMatrices' );
52
+ const cameraProjectionMatrices = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraProjectionMatrices' );
53
53
 
54
54
  cameraProjectionMatrix = cameraProjectionMatrices.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toVar( 'cameraProjectionMatrix' );
55
55
 
56
56
  } else {
57
57
 
58
- cameraProjectionMatrix = uniform( 'mat4' ).label( 'cameraProjectionMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrix );
58
+ cameraProjectionMatrix = uniform( 'mat4' ).setName( 'cameraProjectionMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrix );
59
59
 
60
60
  }
61
61
 
@@ -83,13 +83,13 @@ export const cameraProjectionMatrixInverse = /*@__PURE__*/ ( Fn( ( { camera } )
83
83
 
84
84
  }
85
85
 
86
- const cameraProjectionMatricesInverse = uniformArray( matrices ).setGroup( renderGroup ).label( 'cameraProjectionMatricesInverse' );
86
+ const cameraProjectionMatricesInverse = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraProjectionMatricesInverse' );
87
87
 
88
88
  cameraProjectionMatrixInverse = cameraProjectionMatricesInverse.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toVar( 'cameraProjectionMatrixInverse' );
89
89
 
90
90
  } else {
91
91
 
92
- cameraProjectionMatrixInverse = uniform( 'mat4' ).label( 'cameraProjectionMatrixInverse' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrixInverse );
92
+ cameraProjectionMatrixInverse = uniform( 'mat4' ).setName( 'cameraProjectionMatrixInverse' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrixInverse );
93
93
 
94
94
  }
95
95
 
@@ -117,13 +117,13 @@ export const cameraViewMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
117
117
 
118
118
  }
119
119
 
120
- const cameraViewMatrices = uniformArray( matrices ).setGroup( renderGroup ).label( 'cameraViewMatrices' );
120
+ const cameraViewMatrices = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraViewMatrices' );
121
121
 
122
122
  cameraViewMatrix = cameraViewMatrices.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toVar( 'cameraViewMatrix' );
123
123
 
124
124
  } else {
125
125
 
126
- cameraViewMatrix = uniform( 'mat4' ).label( 'cameraViewMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorldInverse );
126
+ cameraViewMatrix = uniform( 'mat4' ).setName( 'cameraViewMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorldInverse );
127
127
 
128
128
  }
129
129
 
@@ -137,7 +137,7 @@ export const cameraViewMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
137
137
  * @tsl
138
138
  * @type {UniformNode<mat4>}
139
139
  */
140
- export const cameraWorldMatrix = /*@__PURE__*/ uniform( 'mat4' ).label( 'cameraWorldMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorld );
140
+ export const cameraWorldMatrix = /*@__PURE__*/ uniform( 'mat4' ).setName( 'cameraWorldMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorld );
141
141
 
142
142
  /**
143
143
  * TSL object that represents the normal matrix of the camera used for the current render.
@@ -145,7 +145,7 @@ export const cameraWorldMatrix = /*@__PURE__*/ uniform( 'mat4' ).label( 'cameraW
145
145
  * @tsl
146
146
  * @type {UniformNode<mat3>}
147
147
  */
148
- export const cameraNormalMatrix = /*@__PURE__*/ uniform( 'mat3' ).label( 'cameraNormalMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.normalMatrix );
148
+ export const cameraNormalMatrix = /*@__PURE__*/ uniform( 'mat3' ).setName( 'cameraNormalMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.normalMatrix );
149
149
 
150
150
  /**
151
151
  * TSL object that represents the position in world space of the camera used for the current render.
@@ -153,4 +153,4 @@ export const cameraNormalMatrix = /*@__PURE__*/ uniform( 'mat3' ).label( 'camera
153
153
  * @tsl
154
154
  * @type {UniformNode<vec3>}
155
155
  */
156
- export const cameraPosition = /*@__PURE__*/ uniform( new Vector3() ).label( 'cameraPosition' ).setGroup( renderGroup ).onRenderUpdate( ( { camera }, self ) => self.value.setFromMatrixPosition( camera.matrixWorld ) );
156
+ export const cameraPosition = /*@__PURE__*/ uniform( new Vector3() ).setName( 'cameraPosition' ).setGroup( renderGroup ).onRenderUpdate( ( { camera }, self ) => self.value.setFromMatrixPosition( camera.matrixWorld ) );
@@ -1,12 +1,12 @@
1
1
  import { attribute } from '../core/AttributeNode.js';
2
2
  import { cameraViewMatrix } from './Camera.js';
3
3
  import { modelNormalMatrix, modelWorldMatrix } from './ModelNode.js';
4
- import { mat3, vec3, Fn, varying } from '../tsl/TSLBase.js';
4
+ import { mat3, vec3, Fn } from '../tsl/TSLBase.js';
5
5
  import { positionView } from './Position.js';
6
- import { faceDirection } from '../display/FrontFacingNode.js';
6
+ import { directionToFaceDirection } from '../display/FrontFacingNode.js';
7
7
 
8
8
  /**
9
- * TSL object that represents the normal attribute of the current rendered object.
9
+ * TSL object that represents the normal attribute of the current rendered object in local space.
10
10
  *
11
11
  * @tsl
12
12
  * @type {Node<vec3>}
@@ -14,7 +14,7 @@ import { faceDirection } from '../display/FrontFacingNode.js';
14
14
  export const normalGeometry = /*@__PURE__*/ attribute( 'normal', 'vec3' );
15
15
 
16
16
  /**
17
- * TSL object that represents the vertex normal in local space of the current rendered object.
17
+ * TSL object that represents the vertex normal of the current rendered object in local space.
18
18
  *
19
19
  * @tsl
20
20
  * @type {Node<vec3>}
@@ -34,7 +34,7 @@ export const normalLocal = /*@__PURE__*/ ( Fn( ( builder ) => {
34
34
  }, 'vec3' ).once() )().toVar( 'normalLocal' );
35
35
 
36
36
  /**
37
- * TSL object that represents the flat vertex normal in view space of the current rendered object.
37
+ * TSL object that represents the flat vertex normal of the current rendered object in view space.
38
38
  *
39
39
  * @tsl
40
40
  * @type {Node<vec3>}
@@ -42,12 +42,12 @@ export const normalLocal = /*@__PURE__*/ ( Fn( ( builder ) => {
42
42
  export const normalFlat = /*@__PURE__*/ positionView.dFdx().cross( positionView.dFdy() ).normalize().toVar( 'normalFlat' );
43
43
 
44
44
  /**
45
- * TSL object that represents the vertex normal in view space of the current rendered object.
45
+ * TSL object that represents the vertex normal of the current rendered object in view space.
46
46
  *
47
47
  * @tsl
48
48
  * @type {Node<vec3>}
49
49
  */
50
- export const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
50
+ export const normalViewGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
51
51
 
52
52
  let node;
53
53
 
@@ -57,77 +57,99 @@ export const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
57
57
 
58
58
  } else {
59
59
 
60
- node = varying( transformNormalToView( normalLocal ), 'v_normalView' ).normalize();
60
+ node = transformNormalToView( normalLocal ).toVarying( 'v_normalViewGeometry' ).normalize();
61
61
 
62
62
  }
63
63
 
64
64
  return node;
65
65
 
66
- }, 'vec3' ).once() )().toVar( 'normalView' );
66
+ }, 'vec3' ).once() )().toVar( 'normalViewGeometry' );
67
67
 
68
68
  /**
69
- * TSL object that represents the vertex normal in world space of the current rendered object.
69
+ * TSL object that represents the vertex normal of the current rendered object in world space.
70
70
  *
71
71
  * @tsl
72
72
  * @type {Node<vec3>}
73
73
  */
74
- export const normalWorld = /*@__PURE__*/ ( Fn( ( builder ) => {
74
+ export const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
75
75
 
76
- let normal = normalView.transformDirection( cameraViewMatrix );
76
+ let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
77
77
 
78
78
  if ( builder.material.flatShading !== true ) {
79
79
 
80
- normal = varying( normal, 'v_normalWorld' );
80
+ normal = normal.toVarying( 'v_normalWorldGeometry' );
81
81
 
82
82
  }
83
83
 
84
- return normal;
84
+ return normal.normalize().toVar( 'normalWorldGeometry' );
85
85
 
86
- }, 'vec3' ).once() )().normalize().toVar( 'normalWorld' );
86
+ }, 'vec3' ).once() )();
87
87
 
88
88
  /**
89
- * TSL object that represents the transformed vertex normal in view space of the current rendered object.
89
+ * TSL object that represents the vertex normal of the current rendered object in view space.
90
90
  *
91
91
  * @tsl
92
92
  * @type {Node<vec3>}
93
93
  */
94
- export const transformedNormalView = /*@__PURE__*/ ( Fn( ( builder ) => {
94
+ export const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) => {
95
95
 
96
- // Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
96
+ let node;
97
+
98
+ if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
99
+
100
+ node = normalViewGeometry;
97
101
 
98
- let node = builder.context.setupNormal().context( { getUV: null } );
102
+ if ( material.flatShading !== true ) {
99
103
 
100
- if ( builder.material.flatShading !== true ) node = node.mul( faceDirection );
104
+ node = directionToFaceDirection( node );
105
+
106
+ }
107
+
108
+ } else {
109
+
110
+ // Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
111
+
112
+ node = context.setupNormal().context( { getUV: null } );
113
+
114
+ }
101
115
 
102
116
  return node;
103
117
 
104
- }, 'vec3' ).once() )().toVar( 'transformedNormalView' );
118
+ }, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'normalView' );
105
119
 
106
120
  /**
107
- * TSL object that represents the transformed vertex normal in world space of the current rendered object.
121
+ * TSL object that represents the vertex normal of the current rendered object in world space.
108
122
  *
109
123
  * @tsl
110
124
  * @type {Node<vec3>}
111
125
  */
112
- export const transformedNormalWorld = /*@__PURE__*/ transformedNormalView.transformDirection( cameraViewMatrix ).toVar( 'transformedNormalWorld' );
126
+ export const normalWorld = /*@__PURE__*/ normalView.transformDirection( cameraViewMatrix ).toVar( 'normalWorld' );
113
127
 
114
128
  /**
115
- * TSL object that represents the transformed clearcoat vertex normal in view space of the current rendered object.
129
+ * TSL object that represents the clearcoat vertex normal of the current rendered object in view space.
116
130
  *
117
131
  * @tsl
118
132
  * @type {Node<vec3>}
119
133
  */
120
- export const transformedClearcoatNormalView = /*@__PURE__*/ ( Fn( ( builder ) => {
134
+ export const clearcoatNormalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, context } ) => {
121
135
 
122
- // Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
136
+ let node;
123
137
 
124
- let node = builder.context.setupClearcoatNormal().context( { getUV: null } );
138
+ if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
125
139
 
126
- if ( builder.material.flatShading !== true ) node = node.mul( faceDirection );
140
+ node = normalView;
141
+
142
+ } else {
143
+
144
+ // Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
145
+
146
+ node = context.setupClearcoatNormal().context( { getUV: null } );
147
+
148
+ }
127
149
 
128
150
  return node;
129
151
 
130
- }, 'vec3' ).once() )().toVar( 'transformedClearcoatNormalView' );
152
+ }, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'clearcoatNormalView' );
131
153
 
132
154
  /**
133
155
  * Transforms the normal with the given matrix.
@@ -174,3 +196,47 @@ export const transformNormalToView = /*@__PURE__*/ Fn( ( [ normal ], builder ) =
174
196
  return cameraViewMatrix.transformDirection( transformedNormal );
175
197
 
176
198
  } );
199
+
200
+ // Deprecated
201
+
202
+ /**
203
+ * TSL object that represents the transformed vertex normal of the current rendered object in view space.
204
+ *
205
+ * @tsl
206
+ * @type {Node<vec3>}
207
+ * @deprecated since r178. Use `normalView` instead.
208
+ */
209
+ export const transformedNormalView = ( Fn( () => { // @deprecated, r177
210
+
211
+ console.warn( 'THREE.TSL: "transformedNormalView" is deprecated. Use "normalView" instead.' );
212
+ return normalView;
213
+
214
+ } ).once( [ 'NORMAL', 'VERTEX' ] ) )();
215
+
216
+ /**
217
+ * TSL object that represents the transformed vertex normal of the current rendered object in world space.
218
+ *
219
+ * @tsl
220
+ * @type {Node<vec3>}
221
+ * @deprecated since r178. Use `normalWorld` instead.
222
+ */
223
+ export const transformedNormalWorld = ( Fn( () => { // @deprecated, r177
224
+
225
+ console.warn( 'THREE.TSL: "transformedNormalWorld" is deprecated. Use "normalWorld" instead.' );
226
+ return normalWorld;
227
+
228
+ } ).once( [ 'NORMAL', 'VERTEX' ] ) )();
229
+
230
+ /**
231
+ * TSL object that represents the transformed clearcoat vertex normal of the current rendered object in view space.
232
+ *
233
+ * @tsl
234
+ * @type {Node<vec3>}
235
+ * @deprecated since r178. Use `clearcoatNormalView` instead.
236
+ */
237
+ export const transformedClearcoatNormalView = ( Fn( () => { // @deprecated, r177
238
+
239
+ console.warn( 'THREE.TSL: "transformedClearcoatNormalView" is deprecated. Use "clearcoatNormalView" instead.' );
240
+ return clearcoatNormalView;
241
+
242
+ } ).once( [ 'NORMAL', 'VERTEX' ] ) )();
@@ -263,6 +263,6 @@ export const objectViewPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3
263
263
  * @tsl
264
264
  * @function
265
265
  * @param {?Object3D} [object3d] - The 3D object.
266
- * @returns {Object3DNode<vec3>}
266
+ * @returns {Object3DNode<float>}
267
267
  */
268
268
  export const objectRadius = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.RADIUS ).setParameterLength( 1 );