vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.13k stars 92 forks source link

VOXELFORMAT: GLTF: support exporting palette materials #402

Open mgerhardy opened 9 months ago

mgerhardy commented 9 months ago

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.

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

TODO

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 commented 9 months ago

two new cvars were added: voxformat_gltf_khr_materials_pbrspecularglossiness and voxformat_gltf_khr_materials_specular. They control which extension you want to use to save the specular material values in the gltf file. Where will at least be one other cvar to control whether you want to export materials at all.