[Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

Post Reply
User avatar
Noodlemire
Member
Posts: 49
Joined: Sun May 27, 2018 00:07
GitHub: Noodlemire
In-game: Noodlemire

[Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Noodlemire » Post

This mod provides a new method to making 3D models. It comes with voxelmodel.obj, a model consisting of a 17x17x17 grid of overlapping squares. Thus, by simply making different textures for this model, you can make a wide variety of voxelated shapes. It also allows for a very unusual style of animation, as you can use texture-based animation to constantly change the shape of your model and have it act like a 3D sprite.

There are also a few example objects provided. There's a table, a bookshelf that can optionally replace the default bookshelf, an animated floor torch, and a simple cat that can walk around and blink. Note that by default, these are only available in creative mode, except for when the default bookshelf is overridden.

If you want to make your own object using voxelmodel, specifics about how it works are detailed in the init.lua and voxelmodel_guide.png files.
+Screenshot of the provided examples
+The cat's walk animation
Dependencies: none
Optional dependencies: default
Repository: https://github.com/Noodlemire/voxelmodel
Liscense: LGPL 2.1, https://github.com/Noodlemire/voxelmodel/blob/master/LICENSE.txt
Download: https://mega.nz/file/ruIyxYrJ#GefUxLjolTqQ9wx1yZSDX92hDnFnNDPdu05k1TRVYqw

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by PolySaken » Post

This is actually amazing. I never would have thought of doing something like this. It's definitely better than nodeboxes IMO, and the potential for node animation is amazing. (I don't think 3d animated nodes were even possible before).
I don't really understand the texture layout, but it doesn't look too complicated.

User avatar
Noodlemire
Member
Posts: 49
Joined: Sun May 27, 2018 00:07
GitHub: Noodlemire
In-game: Noodlemire

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Noodlemire » Post

PolySaken wrote:
Sun Sep 13, 2020 22:05
(I don't think 3d animated nodes were even possible before).
They were possible, if you followed the same principle that voxelmodel uses, which is to create a file that has all possible geometry that the object will use, and hide parts of it as needed by making parts of the texture blank.
PolySaken wrote:
Sun Sep 13, 2020 22:05
I don't really understand the texture layout, but it doesn't look too complicated.
I tried to make it as simple as possible. It might be easier to understand with a metaphor. Imagine dominoes, except they're square. Grab 17 dominoes, and line them up in a row so that each domino is the same distance away from the previously placed one. Make sure each domino is oriented the same way, and faces the same direction. This is how any single axis looks in voxelmodel.obj. The obj file in its entirety is just three sets of these domino rows, one for each axis, placed so that they overlap perfectly into the shape of a cube.

Now, take that row of dominoes, and start laying them on the floor. Start with the first domino you placed, and work your way downwards, placing one domino directly underneath the last one that you laid on the floor. Like before, also make sure that they are all orientated in the same way. This is how an axis in the model relates to any particular texture made to fit the model. Which column coresponds to which axis is shown in the provided voxelmodel_guide.png file.

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by PolySaken » Post

Oh, that makes sense. I'll try it out later, maybe use it in one of the games I'm working on. Here's a suggestion: perhaps a set of differently sized models, for example a two-node high one for taller entities or nodes. Imagine a fully voxel-animated player model, lol.

User avatar
Noodlemire
Member
Posts: 49
Joined: Sun May 27, 2018 00:07
GitHub: Noodlemire
In-game: Noodlemire

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Noodlemire » Post

PolySaken wrote:
Mon Sep 14, 2020 22:58
Oh, that makes sense. I'll try it out later, maybe use it in one of the games I'm working on. Here's a suggestion: perhaps a set of differently sized models, for example a two-node high one for taller entities or nodes. Imagine a fully voxel-animated player model, lol.
I was thinking of adding more sizes down the line, but I'd prefer to stick to cubic models. A rectangular model wouldn't divide as nicely as I'd like, and it'd be easier overall to keep the same general format as much as possible. You can set the size of the model in-game easily enough anyways, stretching it to whatever size you please, so you could take a theoretical 32x32x32 textured model and scale it to 0.5x on both horizontal axis to get what is effectively a 16x32x16 model.

User avatar
Wuzzy
Member
Posts: 4046
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Wuzzy » Post

This is a very interesting idea!
I wonder how strong the impact on performance is, tho. How many faces?
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Noodlemire
Member
Posts: 49
Joined: Sun May 27, 2018 00:07
GitHub: Noodlemire
In-game: Noodlemire

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Noodlemire » Post

Wuzzy wrote:
Tue Sep 15, 2020 13:15
I wonder how strong the impact on performance is, tho. How many faces?
51 square faces in the model, without backface culling. I haven't tested it very heavily yet, but I'm reasonably certain that the more complex a textured voxelmodel becomes, the faster it'll be in comparison to an equivalent traditional model.

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by PolySaken » Post

A single 9-faced block can slice 1 fps off a raspberry pi, so I imagine 51 faces would be impossible to handle for a lower-end machine. Is backface culling an option? If not, perhaps culling settings would be important in the next engine update.

User avatar
Noodlemire
Member
Posts: 49
Joined: Sun May 27, 2018 00:07
GitHub: Noodlemire
In-game: Noodlemire

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by Noodlemire » Post

PolySaken wrote:
Tue Sep 15, 2020 21:17
A single 9-faced block can slice 1 fps off a raspberry pi, so I imagine 51 faces would be impossible to handle for a lower-end machine.
To be honest, in the context of machines that low end, I don't think there's anything at all I can do to help, other than to tell those users not to use this mod.
PolySaken wrote:
Tue Sep 15, 2020 21:17
Is backface culling an option? If not, perhaps culling settings would be important in the next engine update.
I'm not sure if it's possible or even worth it to have backface culling for specific parts of a texture. Rigth now, backface culling does exist, but it can only turn individual faces on or off. It would be extremely difficult to implement proper backface culling with this setup, and would very likely require defining individual normals on a pixel-by-pixel basis.

It might be easier to understand why backface culling voxelmodels would be so difficult, if I gave a visual example.
+Part 1
+Part 2

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]

by PolySaken » Post

Ah, I see. I don't know how Irrlicht works, but It seems like it could benefit from a reworked culling method, perhaps slice-based culling rather than face-based. I know irrlicht is pretty dead though, so there might be no hope of such a thing. (why do we use irrlicht anyway?)

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests