Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 5 forks source link

[Bug] Emissive materials don't work on newly created vox files #17

Closed Thomasims closed 3 years ago

Thomasims commented 3 years ago

Describe the bug Creating a new Vox file in MagicaVoxel leads to emissive materials not appearing as emissive in game.

To Reproduce Steps to reproduce the behavior:

  1. Open a new blank MagicaVoxel Project.
  2. Create a simple material with emissive properties (Emission > 50 and Power >= 3) and assign it to a few voxels.
  3. Import the Vox file into a Teardown level.
  4. The imported model will not have any emissive voxels.

Expected behavior The voxels using the emissive material should glow in the dark as normal.

Screenshots image

Environment

Analysis After investigating the problem myself, I found the issue is tied to the fact that MagicaVoxel does not create the _g property in the MATL dictionary associated with the emissive palette index. image Upon modifying the entry to contain a _g value of 0.41 (making sure of course that the file stays coherent), the new file starts behaving as expected, with its emissive material now glowing. image

I don't know the purpose of this _g key and why it is necessary for the game to recognize the material as emissive, but it seems to be the only thing causing this bug.

tuxedolabs commented 3 years ago

Thanks for the informative description. This is fixed in 0.7.0.