|
@@ -254,7 +254,7 @@ export const exp2 = nodeProxy( MathNode, MathNode.EXP2 );
|
|
export const log = nodeProxy( MathNode, MathNode.LOG );
|
|
export const log = nodeProxy( MathNode, MathNode.LOG );
|
|
export const log2 = nodeProxy( MathNode, MathNode.LOG2 );
|
|
export const log2 = nodeProxy( MathNode, MathNode.LOG2 );
|
|
export const sqrt = nodeProxy( MathNode, MathNode.SQRT );
|
|
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 floor = nodeProxy( MathNode, MathNode.FLOOR );
|
|
export const ceil = nodeProxy( MathNode, MathNode.CEIL );
|
|
export const ceil = nodeProxy( MathNode, MathNode.CEIL );
|
|
export const normalize = nodeProxy( MathNode, MathNode.NORMALIZE );
|
|
export const normalize = nodeProxy( MathNode, MathNode.NORMALIZE );
|
|
@@ -293,9 +293,13 @@ export const transformDirection = nodeProxy( MathNode, MathNode.TRANSFORM_DIRECT
|
|
|
|
|
|
export const mix = nodeProxy( MathNode, MathNode.MIX );
|
|
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 clamp = ( value, low = 0, high = 1 ) => nodeObject( new MathNode( MathNode.CLAMP, nodeObject( value ), nodeObject( low ), nodeObject( high ) ) );
|
|
|
|
+export const saturate = ( value ) => clamp( value );
|
|
export const refract = nodeProxy( MathNode, MathNode.REFRACT );
|
|
export const refract = nodeProxy( MathNode, MathNode.REFRACT );
|
|
export const smoothstep = nodeProxy( MathNode, MathNode.SMOOTHSTEP );
|
|
export const smoothstep = nodeProxy( MathNode, MathNode.SMOOTHSTEP );
|
|
-export const faceforward = nodeProxy( MathNode, MathNode.FACEFORWARD );
|
|
|
|
|
|
+export const faceForward = nodeProxy( MathNode, MathNode.FACEFORWARD );
|
|
|
|
+
|
|
|
|
+export const mixElement = ( t, e1, e2 ) => mix( e1, e2, t );
|
|
|
|
+export const smoothstepElement = ( x, low, high ) => smoothstep( low, high, x );
|
|
|
|
|
|
addNodeElement( 'radians', radians );
|
|
addNodeElement( 'radians', radians );
|
|
addNodeElement( 'degrees', degrees );
|
|
addNodeElement( 'degrees', degrees );
|
|
@@ -304,7 +308,7 @@ addNodeElement( 'exp2', exp2 );
|
|
addNodeElement( 'log', log );
|
|
addNodeElement( 'log', log );
|
|
addNodeElement( 'log2', log2 );
|
|
addNodeElement( 'log2', log2 );
|
|
addNodeElement( 'sqrt', sqrt );
|
|
addNodeElement( 'sqrt', sqrt );
|
|
-addNodeElement( 'inversesqrt', inversesqrt );
|
|
|
|
|
|
+addNodeElement( 'inverseSqrt', inverseSqrt );
|
|
addNodeElement( 'floor', floor );
|
|
addNodeElement( 'floor', floor );
|
|
addNodeElement( 'ceil', ceil );
|
|
addNodeElement( 'ceil', ceil );
|
|
addNodeElement( 'normalize', normalize );
|
|
addNodeElement( 'normalize', normalize );
|
|
@@ -338,11 +342,12 @@ addNodeElement( 'pow2', pow2 );
|
|
addNodeElement( 'pow3', pow3 );
|
|
addNodeElement( 'pow3', pow3 );
|
|
addNodeElement( 'pow4', pow4 );
|
|
addNodeElement( 'pow4', pow4 );
|
|
addNodeElement( 'transformDirection', transformDirection );
|
|
addNodeElement( 'transformDirection', transformDirection );
|
|
-addNodeElement( 'mix', mix );
|
|
|
|
|
|
+addNodeElement( 'mix', mixElement );
|
|
addNodeElement( 'clamp', clamp );
|
|
addNodeElement( 'clamp', clamp );
|
|
addNodeElement( 'refract', refract );
|
|
addNodeElement( 'refract', refract );
|
|
-addNodeElement( 'smoothstep', smoothstep );
|
|
|
|
-addNodeElement( 'faceforward', faceforward );
|
|
|
|
|
|
+addNodeElement( 'smoothstep', smoothstepElement );
|
|
|
|
+addNodeElement( 'faceForward', faceForward );
|
|
addNodeElement( 'difference', difference );
|
|
addNodeElement( 'difference', difference );
|
|
|
|
+addNodeElement( 'saturate', saturate );
|
|
|
|
|
|
addNodeClass( MathNode );
|
|
addNodeClass( MathNode );
|