diff --git a/pixal3d_mlx/mesh.py b/pixal3d_mlx/mesh.py index 52d653a..fc51200 100644 --- a/pixal3d_mlx/mesh.py +++ b/pixal3d_mlx/mesh.py @@ -28,6 +28,16 @@ import numpy as np # Upstream fixes both: the model always works in a unit cube centred on the origin. AABB = [[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]] +# How the texture decoder's 6 channels map to PBR slots (pipeline's pbr_attr_layout). +# o_voxel indexes this dict by name and raises KeyError on any missing slot, so a +# partial layout fails deep inside the baker rather than at the call. +PBR_ATTR_LAYOUT = { + "base_color": slice(0, 3), + "metallic": slice(3, 4), + "roughness": slice(4, 5), + "alpha": slice(5, 6), +} + def _torch(a): import torch