Skip to content

Commit

Permalink
TSL: Renamed inversesqrt -> inverseSqrt, faceforward -> faceForward,
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Mar 16, 2023
1 parent 818d2ea commit 49b4a18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions examples/jsm/nodes/Nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { default as ArrayUniformNode /* @TODO: arrayUniform */ } from './core/Ar
export { default as AttributeNode, attribute } from './core/AttributeNode.js';
export { default as BypassNode, bypass } from './core/BypassNode.js';
export { default as CacheNode, cache } from './core/CacheNode.js';
export { default as CodeNode, code } from './core/CodeNode.js';
export { default as CodeNode, code, js } from './core/CodeNode.js';
export { default as ConstNode } from './core/ConstNode.js';
export { default as ContextNode, context } from './core/ContextNode.js';
export { default as ExpressionNode, expression } from './core/ExpressionNode.js';
Expand All @@ -35,8 +35,10 @@ export { default as UniformNode, uniform } from './core/UniformNode.js';
export { default as VarNode, label, temp } from './core/VarNode.js';
export { default as VaryingNode, varying } from './core/VaryingNode.js';

export * as NodeUtils from './core/NodeUtils.js';

// math
export { default as MathNode, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inversesqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, negate, invert, dFdx, dFdy, round, reciprocal, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, refract, smoothstep, faceforward } from './math/MathNode.js';
export { default as MathNode, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inverseSqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, negate, invert, dFdx, dFdy, round, reciprocal, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, saturate, refract, smoothstep, faceForward } from './math/MathNode.js';
export { default as OperatorNode, add, sub, mul, div, remainder, equal, assign, lessThan, greaterThan, lessThanEqual, greaterThanEqual, and, or, xor, bitAnd, bitOr, bitXor, shiftLeft, shiftRight } from './math/OperatorNode.js';
export { default as CondNode, cond } from './math/CondNode.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/display/NormalMapNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const perturbNormal2ArbNode = new ShaderNode( ( inputs ) => {
const B = q1perp.mul( st0.y ).add( q0perp.mul( st1.y ) );

const det = T.dot( T ).max( B.dot( B ) );
const scale = faceDirection.mul( det.inversesqrt() );
const scale = faceDirection.mul( det.inverseSqrt() );

return add( T.mul( mapN.x, scale ), B.mul( mapN.y, scale ), N.mul( mapN.z ) ).normalize();

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/nodes/math/MathNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const exp2 = nodeProxy( MathNode, MathNode.EXP2 );
export const log = nodeProxy( MathNode, MathNode.LOG );
export const log2 = nodeProxy( MathNode, MathNode.LOG2 );
export const sqrt = nodeProxy( MathNode, MathNode.SQRT );
export const inversesqrt = nodeProxy( MathNode, MathNode.INVERSE_SQRT );
export const inverseSqrt = nodeProxy( MathNode, MathNode.INVERSE_SQRT );
export const floor = nodeProxy( MathNode, MathNode.FLOOR );
export const ceil = nodeProxy( MathNode, MathNode.CEIL );
export const normalize = nodeProxy( MathNode, MathNode.NORMALIZE );
Expand Down Expand Up @@ -295,7 +295,7 @@ export const mix = nodeProxy( MathNode, MathNode.MIX );
export const clamp = ( value, low = 0, high = 1 ) => nodeObject( new MathNode( MathNode.CLAMP, nodeObject( value ), nodeObject( low ), nodeObject( high ) ) );
export const refract = nodeProxy( MathNode, MathNode.REFRACT );
export const smoothstep = nodeProxy( MathNode, MathNode.SMOOTHSTEP );
export const faceforward = nodeProxy( MathNode, MathNode.FACEFORWARD );
export const faceForward = nodeProxy( MathNode, MathNode.FACEFORWARD );

addNodeElement( 'radians', radians );
addNodeElement( 'degrees', degrees );
Expand All @@ -304,7 +304,7 @@ addNodeElement( 'exp2', exp2 );
addNodeElement( 'log', log );
addNodeElement( 'log2', log2 );
addNodeElement( 'sqrt', sqrt );
addNodeElement( 'inversesqrt', inversesqrt );
addNodeElement( 'inverseSqrt', inverseSqrt );
addNodeElement( 'floor', floor );
addNodeElement( 'ceil', ceil );
addNodeElement( 'normalize', normalize );
Expand Down Expand Up @@ -342,7 +342,7 @@ addNodeElement( 'mix', mix );
addNodeElement( 'clamp', clamp );
addNodeElement( 'refract', refract );
addNodeElement( 'smoothstep', smoothstep );
addNodeElement( 'faceforward', faceforward );
addNodeElement( 'faceForward', faceForward );
addNodeElement( 'difference', difference );

addNodeClass( MathNode );

0 comments on commit 49b4a18

Please sign in to comment.