Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOXELFORMAT: GLTF: support exporting palette materials #402

Open
1 of 3 tasks
mgerhardy opened this issue Mar 1, 2024 · 1 comment
Open
1 of 3 tasks

VOXELFORMAT: GLTF: support exporting palette materials #402

mgerhardy opened this issue Mar 1, 2024 · 1 comment
Labels
enhancement format Voxel or mesh format related

Comments

@mgerhardy
Copy link
Collaborator

mgerhardy commented Mar 1, 2024

1a9c676 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: jpaver/opengametools#64

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

Links

TODO

  • Find sane default values for the palette::Material properties
  • Complete the list of magicavoxel material properties and their gltf match (if any)
  • 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 added a commit that referenced this issue Mar 3, 2024
…magicavoxel interactions

In order to support the new palette material features that are modelled after magicavoxel (see
1a9c676) we have to use some extensions to the gltf spec.

* KHR_materials_emissive_strength
* KHR_materials_ior
* KHR_materials_pbrSpecularGlossiness
* KHR_materials_specular

there are also some new cvars that will control the gltf export extensions - when loading a
model, we will try to load as many extensions as useful automatically. But for saving the
user might have to choose between several options. Some of them can not be used together.

see issue #402
@mgerhardy mgerhardy added enhancement format Voxel or mesh format related labels Mar 4, 2024
@mgerhardy
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement format Voxel or mesh format related
Projects
None yet
Development

No branches or pull requests

1 participant