Skip to content

Commit 51dcb5e

Browse files
committed
MathNode: Add bitcast()
1 parent 8478554 commit 51dcb5e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

examples/jsm/nodes/Nodes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import * as NodeUtils from './core/NodeUtils.js';
3939
export { NodeUtils };
4040

4141
// math
42-
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, oneMinus, dFdx, dFdy, round, reciprocal, trunc, fwidth, 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';
42+
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, 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 } from './math/MathNode.js';
4343
export { default as OperatorNode, add, sub, mul, div, remainder, equal, lessThan, greaterThan, lessThanEqual, greaterThanEqual, and, or, xor, bitAnd, bitOr, bitXor, shiftLeft, shiftRight } from './math/OperatorNode.js';
4444
export { default as CondNode, cond } from './math/CondNode.js';
4545
export { default as HashNode, hash } from './math/HashNode.js';

examples/jsm/nodes/math/MathNode.js

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ MathNode.ROUND = 'round';
220220
MathNode.RECIPROCAL = 'reciprocal';
221221
MathNode.TRUNC = 'trunc';
222222
MathNode.FWIDTH = 'fwidth';
223+
MathNode.BITCAST = 'bitcast';
223224

224225
// 2 inputs
225226

@@ -278,6 +279,7 @@ export const round = nodeProxy( MathNode, MathNode.ROUND );
278279
export const reciprocal = nodeProxy( MathNode, MathNode.RECIPROCAL );
279280
export const trunc = nodeProxy( MathNode, MathNode.TRUNC );
280281
export const fwidth = nodeProxy( MathNode, MathNode.FWIDTH );
282+
export const bitcast = nodeProxy( MathNode, MathNode.BITCAST );
281283

282284
export const atan2 = nodeProxy( MathNode, MathNode.ATAN2 );
283285
export const min = nodeProxy( MathNode, MathNode.MIN );

examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const wgslMethods = {
6464
mod: 'threejs_mod',
6565
lessThanEqual: 'threejs_lessThanEqual',
6666
inversesqrt: 'inverseSqrt'
67+
bitcast: 'bitcast<f32>'
6768
};
6869

6970
const wgslPolyfill = {

0 commit comments

Comments
 (0)