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

Add support for MagicVoxel materials in Minecraft: Glass #120

Closed
acs opened this issue Jul 13, 2020 · 4 comments
Closed

Add support for MagicVoxel materials in Minecraft: Glass #120

acs opened this issue Jul 13, 2020 · 4 comments
Labels

Comments

@acs
Copy link
Contributor

acs commented Jul 13, 2020

For example, the glass ball must be of glass :)

Screenshot from 2020-07-13 06-15-13

@acs acs added the demo label Jul 13, 2020
@acs acs changed the title Add support for MagicVoxel materials in Minecraft Add support for MagicVoxel materials in Minecraft: Glass Jul 13, 2020
@acs
Copy link
Contributor Author

acs commented Jul 14, 2020

Time to review the VOX format: #99

Reading the original and extended format definition in the current version the material is defined in the MATL chunk

(4) Material Chunk : "MATL"

int32	: material id
DICT	: material properties
	  (_type : str) _diffuse, _metal, _glass, _emit
	  (_weight : float) range 0 ~ 1
	  (_rough : float)
	  (_spec : float)
	  (_ior : float)
	  (_att : float)
	  (_flux : float)
	  (_plastic)

Probably we have a "material id" for each voxel, like XYZI and colors, but I need to review the format!

It seems that for each color in the palette we have its material:

[export]$ strings vxs.vox | grep MATL | wc -l
256

To check it, just change the MATL for a color, save it, and diff it with the previous version.

@acs
Copy link
Contributor Author

acs commented Jul 15, 2020

Time to explore. For doing it I will use the model with the voxel logo inside a crystal (glass) ball.

Screenshot from 2020-07-15 06-17-29
Screenshot from 2020-07-15 06-17-15

Simple, we have two colors:

  • Index 1, white, with glass as material
  • Index 21, red, with default material (diffuse)

So we need to read the materials palette and use it in order to select the block to be used in Minecraft.

@acs
Copy link
Contributor Author

acs commented Jul 15, 2020

Without supporting materials it looks like:

Screenshot from 2020-07-15 06-24-50

Interesting result, close to the model version in MV, but pretty far from the rendered one.

@acs
Copy link
Contributor Author

acs commented Jul 15, 2020

All done:

Screenshot from 2020-07-15 08-03-00

Glass and metal are mapped to glass and iron in MC. And this opens the door to use other blocks in MC.

@acs acs closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant