VoxelPlugin / VoxelPluginFreeLegacy

Voxel Plugin Legacy for Unreal Engine
https://voxelplugin.com
1.56k stars 297 forks source link

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

Open dastardlygames opened 3 years ago

dastardlygames commented 3 years ago

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

dastardlygames commented 3 years ago

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

dastardlygames commented 3 years ago

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?

dastardlygames commented 3 years ago

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

Phyronnaz commented 3 years ago

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