Browse Source

TSL: add transpose() function (#28539)

Co-authored-by: aardgoose <[email protected]>
aardgoose 1 year ago
parent
commit
d2340077ac
2 changed files with 4 additions and 1 deletions
  1. 1 1
      examples/jsm/nodes/Nodes.js
  2. 3 0
      examples/jsm/nodes/math/MathNode.js

+ 1 - 1
examples/jsm/nodes/Nodes.js

@@ -38,7 +38,7 @@ import * as NodeUtils from './core/NodeUtils.js';
 export { NodeUtils };
 export { NodeUtils };
 
 
 // math
 // math
-export { default as MathNode, PI, PI2, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inverseSqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, lengthSq, negate, oneMinus, dFdx, dFdy, round, reciprocal, trunc, fwidth, bitcast, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, saturate, refract, smoothstep, faceForward, cbrt, all, any, equals } from './math/MathNode.js';
+export { default as MathNode, PI, PI2, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inverseSqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, lengthSq, negate, oneMinus, dFdx, dFdy, round, reciprocal, trunc, fwidth, bitcast, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, saturate, refract, smoothstep, faceForward, cbrt, transpose, all, any, equals } from './math/MathNode.js';
 
 
 export { default as OperatorNode, add, sub, mul, div, remainder, equal, lessThan, greaterThan, lessThanEqual, greaterThanEqual, and, or, not, xor, bitAnd, bitNot, bitOr, bitXor, shiftLeft, shiftRight } from './math/OperatorNode.js';
 export { default as OperatorNode, add, sub, mul, div, remainder, equal, lessThan, greaterThan, lessThanEqual, greaterThanEqual, and, or, not, xor, bitAnd, bitNot, bitOr, bitXor, shiftLeft, shiftRight } from './math/OperatorNode.js';
 export { default as CondNode, cond } from './math/CondNode.js';
 export { default as CondNode, cond } from './math/CondNode.js';

+ 3 - 0
examples/jsm/nodes/math/MathNode.js

@@ -237,6 +237,7 @@ MathNode.RECIPROCAL = 'reciprocal';
 MathNode.TRUNC = 'trunc';
 MathNode.TRUNC = 'trunc';
 MathNode.FWIDTH = 'fwidth';
 MathNode.FWIDTH = 'fwidth';
 MathNode.BITCAST = 'bitcast';
 MathNode.BITCAST = 'bitcast';
+MathNode.TRANSPOSE = 'transpose';
 
 
 // 2 inputs
 // 2 inputs
 
 
@@ -302,6 +303,7 @@ export const reciprocal = nodeProxy( MathNode, MathNode.RECIPROCAL );
 export const trunc = nodeProxy( MathNode, MathNode.TRUNC );
 export const trunc = nodeProxy( MathNode, MathNode.TRUNC );
 export const fwidth = nodeProxy( MathNode, MathNode.FWIDTH );
 export const fwidth = nodeProxy( MathNode, MathNode.FWIDTH );
 export const bitcast = nodeProxy( MathNode, MathNode.BITCAST );
 export const bitcast = nodeProxy( MathNode, MathNode.BITCAST );
+export const transpose = nodeProxy( MathNode, MathNode.TRANSPOSE );
 
 
 export const atan2 = nodeProxy( MathNode, MathNode.ATAN2 );
 export const atan2 = nodeProxy( MathNode, MathNode.ATAN2 );
 export const min = nodeProxy( MathNode, MathNode.MIN );
 export const min = nodeProxy( MathNode, MathNode.MIN );
@@ -387,5 +389,6 @@ addNodeElement( 'faceForward', faceForward );
 addNodeElement( 'difference', difference );
 addNodeElement( 'difference', difference );
 addNodeElement( 'saturate', saturate );
 addNodeElement( 'saturate', saturate );
 addNodeElement( 'cbrt', cbrt );
 addNodeElement( 'cbrt', cbrt );
+addNodeElement( 'transpose', transpose );
 
 
 addNodeClass( 'MathNode', MathNode );
 addNodeClass( 'MathNode', MathNode );