diff --git a/src-testing/changes.patch b/src-testing/changes.patch index ca9ef9fe8..cbb72a4e3 100644 --- a/src-testing/changes.patch +++ b/src-testing/changes.patch @@ -458,7 +458,7 @@ index 4841d46c..d69010bc 100644 textureNode.levelNode = nodeObject(levelNode); textureNode.referenceNode = this.getSelf(); diff --git a/src-testing/src/nodes/code/CodeNode.ts b/src-testing/src/nodes/code/CodeNode.ts -index 04762469..c62335d9 100644 +index ba31bcab..f564d2c4 100644 --- a/src-testing/src/nodes/code/CodeNode.ts +++ b/src-testing/src/nodes/code/CodeNode.ts @@ -1,5 +1,6 @@ @@ -559,7 +559,7 @@ index 75c17de0..dcea81cc 100644 +export const glslFn = (code: string, includes) => nativeFn(code, includes, 'glsl'); +export const wgslFn = (code: string, includes) => nativeFn(code, includes, 'wgsl'); diff --git a/src-testing/src/nodes/core/ContextNode.ts b/src-testing/src/nodes/core/ContextNode.ts -index c7f478be..9bc47f27 100644 +index c8f9e293..1bb9e4c4 100644 --- a/src-testing/src/nodes/core/ContextNode.ts +++ b/src-testing/src/nodes/core/ContextNode.ts @@ -1,5 +1,6 @@ @@ -598,7 +598,7 @@ index c7f478be..9bc47f27 100644 /** @@ -67,15 +73,15 @@ class ContextNode extends Node { * @param {NodeBuilder} builder - The current node builder. - * @return {String} The type of {@link ContextNode#node}. + * @return {String} The node type. */ - getNodeType(builder) { + getNodeType(builder: NodeBuilder) { @@ -2669,7 +2669,7 @@ index 8a291b92..39c864a4 100644 /** diff --git a/src-testing/src/nodes/core/StackNode.ts b/src-testing/src/nodes/core/StackNode.ts -index 7da88417..01d12e80 100644 +index eb1dadc7..36ade03e 100644 --- a/src-testing/src/nodes/core/StackNode.ts +++ b/src-testing/src/nodes/core/StackNode.ts @@ -1,6 +1,7 @@ @@ -2812,7 +2812,7 @@ index 2efc188e..8fe0929f 100644 this.name = data.name; diff --git a/src-testing/src/nodes/core/UniformNode.ts b/src-testing/src/nodes/core/UniformNode.ts -index c086bae5..ce0f8a5c 100644 +index ed22aef6..35e8ae47 100644 --- a/src-testing/src/nodes/core/UniformNode.ts +++ b/src-testing/src/nodes/core/UniformNode.ts @@ -1,6 +1,10 @@ @@ -2975,7 +2975,7 @@ index 49c06f8f..eb4ac132 100644 +export const shaderStages: NodeShaderStage[] = [...defaultShaderStages, 'compute']; export const vectorComponents = ['x', 'y', 'z', 'w']; diff --git a/src-testing/src/nodes/lighting/LightingContextNode.ts b/src-testing/src/nodes/lighting/LightingContextNode.ts -index 65534abd..d6fc481f 100644 +index 1aa67531..25a4bd72 100644 --- a/src-testing/src/nodes/lighting/LightingContextNode.ts +++ b/src-testing/src/nodes/lighting/LightingContextNode.ts @@ -1,5 +1,23 @@ @@ -3002,7 +3002,7 @@ index 65534abd..d6fc481f 100644 +} /** - * `LightingContextNode` represents an extension of the {@link ContextNode} module + * `LightingContextNode` represents an extension of the {@link module:ContextNode~ContextNode} module @@ -8,11 +26,17 @@ import { nodeProxy, float, vec3 } from '../tsl/TSLBase.js'; * * @augments ContextNode @@ -3023,8 +3023,8 @@ index 65534abd..d6fc481f 100644 * Constructs a new lighting context node. * @@ -21,7 +45,12 @@ class LightingContextNode extends ContextNode { - * @param {Node} [backdropNode=null] - A backdrop node. - * @param {Node} [backdropAlphaNode=null] - A backdrop alpha node. + * @param {Node?} [backdropNode=null] - A backdrop node. + * @param {Node?} [backdropAlphaNode=null] - A backdrop alpha node. */ - constructor(node, lightingModel = null, backdropNode = null, backdropAlphaNode = null) { + constructor( @@ -3599,7 +3599,7 @@ index 2297154c..130b71de 100644 } diff --git a/src-testing/src/renderers/common/Background.ts b/src-testing/src/renderers/common/Background.ts -index 8d112d45..513560a7 100644 +index ab1f8b70..2ce6dfae 100644 --- a/src-testing/src/renderers/common/Background.ts +++ b/src-testing/src/renderers/common/Background.ts @@ -14,18 +14,33 @@ import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; @@ -8505,10 +8505,10 @@ index 7fd09a8c..88989e12 100644 const bindingSnippets = []; diff --git a/src-testing/src/renderers/webgpu/nodes/WGSLNodeFunction.ts b/src-testing/src/renderers/webgpu/nodes/WGSLNodeFunction.ts -index cfee02b6..f4de8500 100644 +index bf309808..fbd5a26a 100644 --- a/src-testing/src/renderers/webgpu/nodes/WGSLNodeFunction.ts +++ b/src-testing/src/renderers/webgpu/nodes/WGSLNodeFunction.ts -@@ -134,7 +134,7 @@ class WGSLNodeFunction extends NodeFunction { +@@ -135,7 +135,7 @@ class WGSLNodeFunction extends NodeFunction { * * @param {String} source - The WGSL source. */ diff --git a/three.js b/three.js index 6a4309b6e..0d5786038 160000 --- a/three.js +++ b/three.js @@ -1 +1 @@ -Subproject commit 6a4309b6e2a4b7cfb6dffe94f372df632cf35b6d +Subproject commit 0d5786038a48a43317b50e7b6406772553bae662 diff --git a/types/three/src/Three.TSL.d.ts b/types/three/src/Three.TSL.d.ts index abc69361f..4306be77b 100644 --- a/types/three/src/Three.TSL.d.ts +++ b/types/three/src/Three.TSL.d.ts @@ -183,8 +183,8 @@ export const grayscale: typeof TSL.grayscale; export const greaterThan: typeof TSL.greaterThan; export const greaterThanEqual: typeof TSL.greaterThanEqual; export const hash: typeof TSL.hash; -export const highPrecisionModelNormalViewMatrix: typeof TSL.highPrecisionModelNormalViewMatrix; -export const highPrecisionModelViewMatrix: typeof TSL.highPrecisionModelViewMatrix; +export const highpModelNormalViewMatrix: typeof TSL.highpModelNormalViewMatrix; +export const highPrecisionModelViewMatrix: typeof TSL.highpModelViewMatrix; export const hue: typeof TSL.hue; export const instance: typeof TSL.instance; export const instanceIndex: typeof TSL.instanceIndex; @@ -223,6 +223,7 @@ export const log2: typeof TSL.log2; export const logarithmicDepthToViewZ: typeof TSL.logarithmicDepthToViewZ; export const loop: typeof TSL.loop; export const luminance: typeof TSL.luminance; +export const mediumpModelViewMatrix: typeof TSL.mediumpModelViewMatrix; export const mat2: typeof TSL.mat2; export const mat3: typeof TSL.mat3; export const mat4: typeof TSL.mat4; diff --git a/types/three/src/materials/nodes/NodeMaterial.d.ts b/types/three/src/materials/nodes/NodeMaterial.d.ts index 69ea04fa8..da9483d8b 100644 --- a/types/three/src/materials/nodes/NodeMaterial.d.ts +++ b/types/three/src/materials/nodes/NodeMaterial.d.ts @@ -76,6 +76,8 @@ declare class NodeMaterial extends Material { setupClipping(builder: NodeBuilder): ClippingNode | null; setupHardwareClipping(builder: NodeBuilder): void; setupDepth(builder: NodeBuilder): void; + setupPositionView(): Node; + setupVertex(builder: NodeBuilder): Node; setupPosition(builder: NodeBuilder): Node; setupDiffuseColor(builder: NodeBuilder): void; setupVariants(builder: NodeBuilder): void; diff --git a/types/three/src/nodes/Nodes.d.ts b/types/three/src/nodes/Nodes.d.ts index bce1902b7..64ba709c9 100644 --- a/types/three/src/nodes/Nodes.d.ts +++ b/types/three/src/nodes/Nodes.d.ts @@ -75,7 +75,6 @@ export { default as InstanceNode } from "./accessors/InstanceNode.js"; export { default as MaterialNode, MaterialNodeScope } from "./accessors/MaterialNode.js"; export { default as MaterialReferenceNode } from "./accessors/MaterialReferenceNode.js"; export { default as ModelNode } from "./accessors/ModelNode.js"; -export { default as ModelViewProjectionNode } from "./accessors/ModelViewProjectionNode.js"; export { default as MorphNode } from "./accessors/MorphNode.js"; export { default as Object3DNode } from "./accessors/Object3DNode.js"; export { default as PointUVNode } from "./accessors/PointUVNode.js"; diff --git a/types/three/src/nodes/accessors/ModelNode.d.ts b/types/three/src/nodes/accessors/ModelNode.d.ts index 12280a2b6..b7956a200 100644 --- a/types/three/src/nodes/accessors/ModelNode.d.ts +++ b/types/three/src/nodes/accessors/ModelNode.d.ts @@ -18,7 +18,15 @@ export const modelScale: ShaderNodeObject; export const modelViewPosition: ShaderNodeObject; export const modelNormalMatrix: ShaderNodeObject; export const modelWorldMatrixInverse: ShaderNodeObject>; + export const modelViewMatrix: ShaderNodeObject; -export const highPrecisionModelViewMatrix: ShaderNodeObject; -export const highPrecisionModelNormalViewMatrix: ShaderNodeObject; +// GPU Precision + +export const mediumpModelViewMatrix: ShaderNodeObject; + +// CPU Precision + +export const highpModelViewMatrix: ShaderNodeObject; + +export const highpModelNormalViewMatrix: ShaderNodeObject; diff --git a/types/three/src/nodes/accessors/ModelViewProjectionNode.d.ts b/types/three/src/nodes/accessors/ModelViewProjectionNode.d.ts index 18302d638..a9f1d1823 100644 --- a/types/three/src/nodes/accessors/ModelViewProjectionNode.d.ts +++ b/types/three/src/nodes/accessors/ModelViewProjectionNode.d.ts @@ -1,8 +1,4 @@ import Node from "../core/Node.js"; -import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; -export default class ModelViewProjectionNode extends Node { - constructor(positionNode?: Node); -} - -export const modelViewProjection: (position?: NodeRepresentation) => ShaderNodeObject; +export const modelViewProjection: ShaderNodeObject; diff --git a/types/three/src/nodes/core/UniformNode.d.ts b/types/three/src/nodes/core/UniformNode.d.ts index f70eefcf2..31e942452 100644 --- a/types/three/src/nodes/core/UniformNode.d.ts +++ b/types/three/src/nodes/core/UniformNode.d.ts @@ -55,7 +55,7 @@ declare class UniformNode extends InputNode { } export default UniformNode; /** - * TSL function for creating a uniform node with the given paramters. + * TSL function for creating a uniform node. * * @function * @param {Any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).