Nodes/BrainDead Nodes/BD Sample Voxelgrid PBR
ComfyUI Node

BD Sample Voxelgrid PBR

Grab color, metallic, and roughness straight from the voxels

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Sample Voxelgrid PBR
  • mesh
  • voxelgrid
  • mesh
  • metallic_json
  • roughness_json
  • status
sampling_modeface
default_color0.5,0.5,0.5,1.0
default_metallic0.00
default_roughness0.50
distance_threshold3.0

BD Sample Voxelgrid Colors pulls color off a TRELLIS2 voxelgrid. This is its sibling with the bigger appetite: BD Sample Voxelgrid PBR samples the full physical material - color, metallic, and roughness - from the voxel attributes and bakes them onto the mesh. It's the shortcut when you don't need a full UV-unwrapped PBR texture (that's BD OVoxel Bake's job) but you want the material data riding on the vertices, ready for export or further processing.

What it is

TRIMESH + VOXELGRID in, TRIMESH (with material attributes) out - plus the material values exposed as JSON strings so you can actually inspect what was sampled. TRELLIS.2's voxelgrid carries more than color; each voxel can hold the metallic/roughness channel values that make a surface read as painted metal versus worn fabric. This node gets those attributes onto your mesh geometry.

How it works

Same sampling architecture as the color version, same three modes with the same tradeoffs:

  • face (default) - one solid material per face, no bleeding, and because colors/values change discretely at boundaries, BD Blender Edge Marking can detect the seams. Splits vertices to keep faces independent.
  • sharp - per-vertex nearest neighbor (k=1); shared values at edges, smooth-looking, but edge marking can't see boundaries.
  • smooth - per-vertex k=4 blended; smooth gradients for organic, high-poly results.

Controls: default_color (RGBA fallback for empty areas), default_metallic (0 default), default_roughness (0.5 default - sensible, since most of a character isn't metal and isn't mirror-smooth), and distance_threshold (max voxel distance before falling back to defaults).

Outputs: the material-carrying mesh, plus metallic_json and roughness_json (per-face or per-vertex material values serialized so you can log, inspect, or pipe them onward), and status.

Where it fits

If your goal is a fully textured, game-engine-ready asset, you actually want BD OVoxel Bake - that produces real albedo/normal/roughness/metallic maps with a UV layout. This node is for the vertex-attribute path: when you're sampling colors anyway and want the material channels riding along, or when you're building toward a vertex-colored export and need metal/roughness to survive. It also plays with the low-poly chain - sample PBR at high res, decimate with BD Smart Decimate, then BD Transfer Vertex Colors back onto the decimated mesh. The JSON outputs are the honest part of this design: the pack would rather show you the sampled values than let you assume they're right.

Gotchas

The shared voxelgrid caveats apply: needs ComfyUI-TRELLIS2 installed (the BrainDead TRELLIS2 nodes import the trellis2 package from that sibling pack), and distance_threshold too low leaves gray/unset patches on low-res voxelgrids. Also remember face mode is the mode that keeps edge-marking working - if you sample smooth and then wonder why hard-edge detection finds nothing, the mode is your answer.

Installing it

ComfyUI Manager: search "BrainDead" → install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

Restart, find it under 🧠BrainDead/Mesh, alongside the other TRELLIS2-adjacent sampling tools. Wire mesh + voxelgrid from a TRELLIS.2 node or BD Load OVoxel, pick face mode, and check the JSON output on your first run to see what the voxelgrid is actually carrying before you trust it downstream.

Category🧠BrainDead/Mesh

Inputs (7)

NameTypeDefaultDescription
meshTRIMESH
voxelgridVOXELGRID
sampling_modeoptCOMBOfaceface=CORNER domain (edge marking works) | sharp=POINT k=1 | smooth=POINT k=4 blended
default_coloroptSTRING0.5,0.5,0.5,1.0
default_metallicoptFLOAT0.000–1
default_roughnessoptFLOAT0.500–1
distance_thresholdoptFLOAT3.01–10Max voxels distance before using default values

Outputs (4)

NameTypeDescription
meshTRIMESH
metallic_jsonSTRING
roughness_jsonSTRING
statusSTRING