BitcountNode

Last modified: Nov 10, 2025

This node represents an operation that counts the bits of a piece of shader data.

Constructor

new BitcountNode(method, aNode)
ParameterTypeDefault Value
method"countTrailingZeros" | "countLeadingZeros" | "countOneBits"
aNodeNode

Constructs a new math node.

AccessorType

Properties

PropertyTypeDefault Value
isBitcountNodeboolean
MethodType

Extends

MathNode

countTrailingZeros

Finds the number of consecutive 0 bits from the least significant bit of the input value, which is also the index of the least significant bit of the input value.

Can only be used with WebGPURenderer and a WebGPU backend.

ParameterTypeDefault Value
xNode | number

Returns

Node

countLeadingZeros

Finds the number of consecutive 0 bits starting from the most significant bit of the input value.

Can only be used with WebGPURenderer and a WebGPU backend.

ParameterTypeDefault Value
xNode | number

Returns

Node

countOneBits

Finds the number of ’1’ bits set in the input value

Can only be used with WebGPURenderer and a WebGPU backend.

Returns

Node