vengi icon indicating copy to clipboard operation
vengi copied to clipboard

VOXELFORMAT: GLTF: support exporting palette materials

Open mgerhardy opened this issue 4 months ago • 1 comments

1a9c6763fd9e7f87b080da31dbc1e682e59773a6 added material support to the palette (palette::Palette) - formats like gltf should now also export (and maybe even import if possible) these values into the palette::Material structure.

  • https://github.khronos.org/glTF-Validator/
  • https://sandbox.babylonjs.com/

This property is not yet handled, too: https://github.com/jpaver/opengametools/issues/64

The test file was kindly provided by AbductedbyPixel and is available at data/tests/test_material.vox

Links

  • https://magicavoxel.fandom.com/wiki/Matter_panel_(interface)
  • https://magicavoxel.fandom.com/wiki/Material_(interface)
  • https://magicavoxel.fandom.com/wiki/Diffuse_(interface)
  • https://magicavoxel.fandom.com/wiki/Plastic_(interface)
  • https://magicavoxel.fandom.com/wiki/Metal_(interface)
  • https://magicavoxel.fandom.com/wiki/Cloud_(interface)
  • https://magicavoxel.fandom.com/wiki/Glass_(interface)
  • https://magicavoxel.fandom.com/wiki/Emission_(interface)

TODO

  • [ ] Find sane default values for the palette::Material properties
  • [ ] Complete the list of magicavoxel material properties and their gltf match (if any)
  • [x] Allow to disable material export via cvar

Material mappings

This table is here to understand and map the mv material settings from ogt_vox to gltf

https://docs.google.com/spreadsheets/d/14cHbGMr7U-_N9mNNSdnb4XkuqvnvkcgCD9IKz_kglfg/edit#gid=2116874397

From MV changelog:

New Unified Material System[06/30/2020] Blend Material: weighted blending Metal/Plastic/Glass/Cloud materials (similar to Disney Principled BRDF). SSS Material: sub-surface scattering. transparency tp control light transmission. density to control light scattering. Aborb/Scatter/Emissive Media Material: emissive cloud. can be contained in the glass with ior > 1. Improved Alpha Blending: glass material, absorb media type, density = 0, ior = 0, transparency > 0

mgerhardy avatar Mar 01 '24 18:03 mgerhardy