GameMaker (2.3)
Icon

Voxel Import

Sifai

You must be logged in to obtain assets

Description

This asset allow you to import Magica Voxel models (.vox) in your projects!

Unfortunately, I have lost the motivation to work on this project, so I am making it free.

Attention! This is only load the models! Without any collision data! Highly recommend compile project with YYC. Please use asset only for GMS 2.3!

You also can try compiled demo!

Features:

  • Import Magica Voxel (.vox) models

  • Models can be stored in one vertex buffer for better perfomance

  • Support frame based animation (you must use Magica Voxel 0.98.2)

  • Simple texture support

  • Support to set scale

  • Support to set origin

  • Easy to use

limitations:

  • If you load many models through a loop, it can take a lot of memory (make small loops)

  • Large levels can take a long time to load

  • Maximal size of model is 256x256x256 voxels

  • Models is not optimazed when is loaded. Each voxel have external sides. (2 triangle for each side) But inner sides not be generated.

List of functions:

VI_init()
VI_data_load(fname)
VI_data_unload(data)
VI_data_get_frames(data)
VI_data_get_palette(data)
VI_model_create(data, x, y, z, scale, origin)
VI_model_complex_start(frames)
VI_model_complex_add(complex, data, x, y, z, scale, origin)
VI_model_complex_end(complex)
VI_model_draw(model, frame, texture, x, y, z)
VI_model_draw_ext(model, frame, texture, x, y, z, xrotation, yrotation, zrotation, xscale, yscale, zscale)
VI_model_destroy(model)

End User Licence Agreement (EULA).

Age Rating: 4+

Versions

GMS2 - Version 1.0.1. Published November 20, 2020

  • Fixed bug when VI_model_get_frames returns wrong numbers of frames
  • Added new function VI_model_get_palette (it return array with 256 colors)

GMS2.3 - Version 1.1.2. Published February 17, 2021

  • All functions are rewritten for version 2.3.0!
  • Models are now loaded into memory using the new VI_data_load function. Previously, to create a model, game had to constantly open and read a file.
  • Due to the addition of the VI_data_load function, a lot of work has been done to rewrite the old code.
  • Added VI_data_unload function to unload information about models from memory if they are no longer needed.
  • Renamed the VI_model_get_frames and VI_model_get_palette functions to VI_data_get_frames and VI_data_get_palette.
  • Changed the origin system of models. Now the argument takes an array of 3 values, which is much clearer and more convenient. By default, the center [0, 0, 0] is in the upper left corner at the bottom of the model.
  • Slightly changed the code for drawing models. Now you need to call matrix_set(matrix_world, matrix_build_identity()) after the VI_model_draw and VI_model_draw_ext functions. This change made it possible to slightly speed up the draw of models.
  • Fixed a bug with model normals (I hope), which led to incorrect display of light.
  • Added a new demo. The already familiar landscape, but without using the VI_model_complex_start function to clearly show the difference in fps.
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait