|
@@ -235,7 +235,6 @@ export const negate = nodeProxy( MathNode, MathNode.NEGATE );
|
|
export const invert = nodeProxy( MathNode, MathNode.INVERT );
|
|
export const invert = nodeProxy( MathNode, MathNode.INVERT );
|
|
export const dFdx = nodeProxy( MathNode, MathNode.DFDX );
|
|
export const dFdx = nodeProxy( MathNode, MathNode.DFDX );
|
|
export const dFdy = nodeProxy( MathNode, MathNode.DFDY );
|
|
export const dFdy = nodeProxy( MathNode, MathNode.DFDY );
|
|
-export const saturate = nodeProxy( MathNode, MathNode.SATURATE );
|
|
|
|
export const round = nodeProxy( MathNode, MathNode.ROUND );
|
|
export const round = nodeProxy( MathNode, MathNode.ROUND );
|
|
|
|
|
|
export const atan2 = nodeProxy( MathNode, MathNode.ATAN2 );
|
|
export const atan2 = nodeProxy( MathNode, MathNode.ATAN2 );
|
|
@@ -254,7 +253,7 @@ export const pow4 = nodeProxy( MathNode, MathNode.POW, 4 );
|
|
export const transformDirection = nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION );
|
|
export const transformDirection = nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION );
|
|
|
|
|
|
export const mix = nodeProxy( MathNode, MathNode.MIX );
|
|
export const mix = nodeProxy( MathNode, MathNode.MIX );
|
|
-export const clamp = nodeProxy( MathNode, MathNode.CLAMP );
|
|
|
|
|
|
+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 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 );
|
|
@@ -274,5 +273,5 @@ export const element = nodeProxy( ArrayElementNode );
|
|
// miscellaneous
|
|
// miscellaneous
|
|
|
|
|
|
export const difference = ( a, b ) => nodeObject( abs( sub( a, b ) ) );
|
|
export const difference = ( a, b ) => nodeObject( abs( sub( a, b ) ) );
|
|
-export const dotNV = saturate( dot( transformedNormalView, positionViewDirection ) );
|
|
|
|
|
|
+export const dotNV = clamp( dot( transformedNormalView, positionViewDirection ) );
|
|
export const transformedNormalWorld = normalize( transformDirection( transformedNormalView, cameraViewMatrix ) );
|
|
export const transformedNormalWorld = normalize( transformDirection( transformedNormalView, cameraViewMatrix ) );
|