This node represents an operation that counts the bits of a piece of shader data.
Constructor
new BitcountNode(method, aNode)| Parameter | Type | Default Value |
|---|---|---|
| method | "countTrailingZeros" | "countLeadingZeros" | "countOneBits" | — |
| aNode | Node | — |
Constructs a new math node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| isBitcountNode | boolean | — | |
| Method | Type | |
|---|---|---|
| _resolveElementType | (inputNode: any, outputNode: Node<…>, elementType: string) => void | |
| _returnDataNode | (inputType: any) => any | |
| _createTrailingZerosBaseLayout | (method: string, elementType: string) => Function | |
| _createLeadingZerosBaseLayout | (method: string, elementType: string) => Function | |
| _createOneBitsBaseLayout | (method: string, elementType: string) => Function | |
| _createMainLayout | (method: string, inputType: string, typeLength: number, baseFn: Function) => Function | |
| setup | (builder: any) => any | |
Extends
MathNodeFinds 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.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds 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.
| Parameter | Type | Default Value |
|---|---|---|
| x | Node | number | — |
Returns
NodeFinds the number of ’1’ bits set in the input value
Can only be used with WebGPURenderer and a WebGPU backend.
Returns
Node