tex/Builder code/Globals tex/Output geo/VolumeFromTexture
Documentation / Node reference / geo nodes
geo/VolumeFromTexture
Turns a 3D texture into a volume, one voxel per texel.
Volume
Brings a 3D texture made in a TEX network into the scene as a VOLUME, so you can render it with mat/Volume, mesh it with geo/VolumeTriangulate, smooth it, or keep building on it with any other volume node. It is the reverse of tex/Volume, which turns a volume into a 3D texture.
Point `texturePath` at the TEX node showing the texture: a 3D tex/Builder, a tex/Solver stepping a 3D state, or a tex/Volume. A 2D picture is refused: a picture has no one obvious shape in 3D, and sampling it onto geometry you already have is what a builder is for.
**The grid follows the texture.** A texture of 64 by 32 by 16 gives a volume of 64 by 32 by 16 voxels. `size` is the length of the LONGEST side in world units, and the voxels are cubes, so the other sides keep the texture's proportions. `center` is where the middle of the volume sits.
**Each channel you turn on becomes a field**, named by its attribute: red into DENSITY by default. Turn on `vector` to write red, green and blue into one Vector3 field instead, a velocity for instance. Half and full floats come in as they are. 8-bit channels come in from 0 to 1, with sRGB colour turned back into linear values. Integer formats are refused.
**A texture made on the GPU is read back to the CPU**, and that has a cost: a 128 by 128 by 128 RGBA16Float texture is 16 MB to copy. In a browser the copy lands a tick or more later, and the nodes below this one wait for it. A texture that changes every frame, like a tex/Solver's, is read again every frame, but only while something shows this node or a node below it. Changing only `center`, `size` or the fields reuses the copy already made.
The viewport draws at most 33.5 million voxels of one volume, so a texture larger than that is refused.
Parameters
| Name | Type | What it does |
|---|---|---|
| texturePath | NodePath | The TEX node showing the 3D texture: a 3D tex/Builder, a tex/Solver or a tex/Volume. |
| importR | Bool | Import the red channel as a field. |
| attributeR | AttributeName | The field the red channel is written to. |
| importG | Bool | Import the green channel as a field. |
| attributeG | AttributeName | The field the green channel is written to. |
| importB | Bool | Import the blue channel as a field. |
| attributeB | AttributeName | The field the blue channel is written to. |
| importA | Bool | Import the alpha channel as a field. |
| attributeA | AttributeName | The field the alpha channel is written to. |
| vector | Bool | Write red, green and blue into one Vector3 field instead of three float fields. Alpha still follows its own toggle. |
| vectorAttribute | AttributeName | The Vector3 field red, green and blue are written to. |
| center | Vector3 | Where the middle of the volume sits, in world units. |
| size | Float | The length of the volume's longest side, in world units. The voxels are cubes, so the other sides keep the texture's proportions. |
Examples
Scenes you can open in the editor that teach this node.
See also
- tex/Volume
- tex/Builder
- tex/Solver
- geo/VolumeTriangulate
- mat/Volume
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.