[Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
- Noodlemire
- Member
- Posts: 61
- Joined: Sun May 27, 2018 00:07
- GitHub: Noodlemire
- In-game: Noodlemire
[Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
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.
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
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.
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
- PolySaken
- Member
- Posts: 817
- 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]
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.
I don't really understand the texture layout, but it doesn't look too complicated.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
- Noodlemire
- Member
- Posts: 61
- Joined: Sun May 27, 2018 00:07
- GitHub: Noodlemire
- In-game: Noodlemire
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
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.
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.
- PolySaken
- Member
- Posts: 817
- 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]
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.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
- Noodlemire
- Member
- Posts: 61
- Joined: Sun May 27, 2018 00:07
- GitHub: Noodlemire
- In-game: Noodlemire
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
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.PolySaken wrote: ↑Mon Sep 14, 2020 22:58Oh, 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.
- Wuzzy
- Member
- Posts: 4804
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
This is a very interesting idea!
I wonder how strong the impact on performance is, tho. How many faces?
I wonder how strong the impact on performance is, tho. How many faces?
- Noodlemire
- Member
- Posts: 61
- Joined: Sun May 27, 2018 00:07
- GitHub: Noodlemire
- In-game: Noodlemire
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
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.
- PolySaken
- Member
- Posts: 817
- 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]
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.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
- Noodlemire
- Member
- Posts: 61
- Joined: Sun May 27, 2018 00:07
- GitHub: Noodlemire
- In-game: Noodlemire
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
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.
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.
First, look at this close-up of the voxelmodel cat. See the inner part of the ear I outlined? See how it looks like it's just one face, that would be pointed forward and should therefore be culled when looking at it backwards?
Now look at this highlighted section of the cat's head. Not only is that not six faces but one, it's also part of the exact same face as the inner part of the ear that I mentioned in part 1. Yes, the same spot on the opposite ear also belongs to this one face. If you tried the current automatic method of backface culling, you would just see though one side of the ear or the other. The only way to see both is to have either no backface culling, or super manual pixel-by-pixel backface culling.
- PolySaken
- Member
- Posts: 817
- 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]
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?)
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
This is just awesome, really good work!
I love the bookshelf in special.
But I've found a bug in it, the yellow book downside is broken, see the attachment.
I love the bookshelf in special.
But I've found a bug in it, the yellow book downside is broken, see the attachment.
- j0j0n4th4n
- Member
- Posts: 256
- Joined: Tue Jan 26, 2021 06:45
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
I try to do the same thing you did with the with bookshelf to the vesselshelf but I keep getting this error:
This is what I did in the nodes.lua file:
Code: Select all
ModError: Failed to load and run script from /home/j0j0/.minetest/mods/voxelmodel/init.lua:
/home/j0j0/.minetest/mods/voxelmodel/nodes.lua:10: Attempt to override non-existent item vessels:shelf
stack traceback:
[C]: in function 'error'
/usr/share/games/minetest/builtin/game/register.lua:402: in function 'override_item'
/home/j0j0/.minetest/mods/voxelmodel/nodes.lua:10: in main chunk
[C]: in function 'dofile'
/home/j0j0/.minetest/mods/voxelmodel/init.lua:44: in main chunk
Verifique o debug.txt para mais detalhes.
This is what I did in the nodes.lua file:
Code: Select all
minetest.override_item("vessels:shelf", {
drawtype = "mesh",
mesh = "voxelmodel.obj",
tiles = {"voxelmodel_vesselshelf.png"},
inventory_image = "voxelmodel_vesselshelf_inv.png",
wield_image = "voxelmodel_vesselshelf_inv.png",
})
cdb_894a100ddd76
- j0j0n4th4n
- Member
- Posts: 256
- Joined: Tue Jan 26, 2021 06:45
Re: [Mod] Template to Easily Make Fancy Voxelized Models [voxelmodel]
*facepalm*
I had forgot vessels was not in default. That was the problem, I added as dependency and everything worked.
Here is a screenshot of the vessel shelf I made:
And here is the texture:
I had forgot vessels was not in default. That was the problem, I added as dependency and everything worked.
Here is a screenshot of the vessel shelf I made:
And here is the texture:
cdb_894a100ddd76
Who is online
Users browsing this forum: Google [Bot] and 40 guests