VoxelPlugin/VoxelPluginFreeLegacy

Voxel Material Collection support for range of indexes per layer (MagicaVoxel)

Opened this issue · 4 comments

It'd be helpful to be able to have a Material Collection that supports specifying a range of indexes to be applied different materials.

In MagicaVoxel you can uses the NOTE field to give one of the 32 palette slots (8 slots/indexes) a shared material/name. I'd like to emulate that with Voxel plugin where a group of indexes have the same material applied but with their different Vertex Colours

An example being, say you wanted 1-8 to share the same Metal material and the next bank of indexes 9-16 use the same Wood Material.

This could perhaps be in the form of a slider or a start & end layer index per layer in the collection. The game Teardown does something similar to this.

magicaVoxelPaletteIndex   Note

voxelMaterial

Here's an example map (in the .zip file) from Teardown. It uses the NOTE field in the vox file format to label banks the palette (32 banks of 8) with a different material/category.

Ideally I'd like to have 255 colours but fewer materials in use. One per type of physical material: diffuse, glass, metal, wood, paper etc. whilst keeping the vertex colour data.
island.zip

image
I expect this wouldn't be compatible with the hardness system in VoxelDataAssets. Perhaps if there was a way to map palette indexes to a single index whilst preserving the vertex colours data?

image
This may well be the solution although not super intuitive.

That's a great idea! Having the basic material collection and the hardness support ranges should be relatively easy to do and would be really helpful