instanceCullingMatrix
instanceCullingMatrix(culler : ComputeInstanceCulling, idNode : Node<int>) : Node<mat4>Fetch the instance matrix for a culled instance.
Use this when you need the per-instance matrix in custom nodes without manually
indexing refMatNode.
Example: Extract world position
Parameters
The GPU instance culler.
idNodeoptionalNode<int>Optional instance id node. Defaults to culled id.
Returns
Node<mat4> — Instance matrix for the culled instance.Example
import { instanceCullingMatrix } from '@three-blocks/core';
import { vec3 } from 'three/tsl';
const M = instanceCullingMatrix(culler);
const worldPos = vec3(M[3].x, M[3].y, M[3].z);