Documentation / Node reference / code nodes
code/VolumeVoxel
Reads one voxel of a volume wired into this geo/VolumeBuilder, at the voxel being written.
Volume
Wire a volume into one of the builder's inputs and this node reads one of its attributes, density by default, at the voxel being written, exactly, with no blending. Move the read with offsetX, offsetY and offsetZ, in whole voxels: an offset of 1, 0, 0 reads the next voxel along x, 0, -1, 0 the one before along y. Seven of these nodes read a voxel and its six face neighbours, which is what a diffusion or a reaction-diffusion step needs. Inside a geo/Solver, input 0 is the volume of the step before, so a step reads its own last result.
The voxels are counted, not measured: voxel 3, 4, 5 of the volume being written reads voxel 3, 4, 5 of the input plus the offset, wherever the two volumes are and whatever their voxel sizes. The input is read as it came in, so on the builder's own input 0 it reads the volume before the builder wrote to it.
borderMode says what is read past the edge of the input, on each axis. CLAMP repeats the edge voxels. TRANSPARENT reads zero. REPEAT reads the opposite side, so a simulation wraps around as on a tile. MIRROR reads the volume flipped at its edge.
To read a volume at a position, blended between voxels, use code/VolumeSample.
Parameters
| Name | Type | What it does |
|---|---|---|
| inputIndex | UInt8 | Which of the builder's inputs holds the volume, 0 to 3. Its first volume object is read. |
| name | AttributeName | The volume attribute to read. |
| geoType | UInt8 FLOAT · INDEX · U32 · VECTOR2 · VECTOR3 · VECTOR4 · VECTOR2_64 · VECTOR3_64 · FLOAT64 · VECTOR2_U32 · VECTOR3_U32 · VECTOR4_U32 | The attribute's type: a float or a float vector. |
| offsetX | SInt32 | How many voxels further along x than the voxel being written to read. Negative reads the other way. |
| offsetY | SInt32 | How many voxels further along y than the voxel being written to read. Negative reads the other way. |
| offsetZ | SInt32 | How many voxels further along z than the voxel being written to read. Negative reads the other way. |
| borderMode | UInt8 CLAMP · TRANSPARENT · REPEAT · MIRROR | What is read past the edge of the volume. CLAMP: the edge voxels repeat. TRANSPARENT: zero. REPEAT: the opposite side, for a simulation that wraps around. MIRROR: the volume flipped at its edge. |
See also
This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.