Smooth voxel surfaces

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Smooth voxel surfaces

by MirceaKitsune » Fri May 29, 2015 13:41

This is a feature I discussed with the Minetest team long ago, because I consider it a fantastic ability which can be easily implemented into any voxel engine. I was reminded of it a few days ago, when someone asked me to consider implementing this exact thing into Minetest, and mentioned it is something they would really enjoy. That brought the feature back to my attention, and I'm seriously considering a way to make it happen. I was also shown a video of someone who, amazingly enough, managed to do this in Minecraft through a mod:

http://www.youtube.com/watch?v=af-HNsT3RVE

Castle Story is an even better example of what I'm hoping to achieve, which uses a more complete smoothing system to create soft surfaces from voxel points (possibly the Marching Cubes algorithm). Here's a few images that show what I mean:

+ Spoiler


Patterns by Linden Lab is an example of simpler smooth voxel terrain, using only straight and diagonal surfaces. This approach might be easier for us, as we can simply add an optional subdivision system on top of it to create the smoothness.

+ Spoiler


But the general idea is simple: Some nodes would have a special flag that mark them as smooth. When used, they would no longer be rendered as blocks, and instead a simple combination of flat and diagonal surfaces is generated between the voxels. The level of subdivisions for the collision mesh and the visual mesh should be two separate settings in minetest.conf, so people can adjust them based on their computer's performance.

This might sound extremely difficult to do, but I don't actually think it is all that much. For the most part, we should only need to edit the paragraph of code that generates the surfaces for voxels. If we know the right algorithm, we should be able to create basic polygonal slopes, then add an optional subdivision counter. We might later want this to be accompanied by other features, such as gradual texture blending, but that's of course for another day.

My first question is if this feature can be accepted into mainstream Minetest. Obviously it won't affect existing mods or games and voxels will remain blocks by default, but the feature might change Minetest's position and direction (in my opinion for the better). If yes, then I'd like any hints as to where exactly in the code surfaces are generated for voxels, and any other tips you have on how this can be programmed. And of course, I also wish to know if anyone is willing to help with this, and what you all think of the idea and who else wants it to begin with.
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Smooth voxel surfaces

by RHR » Fri May 29, 2015 14:04

Isn't that already possible if you create a mod if you use mesh nodes? I think I have already seen some smooth terrain screenshots on this forum some weeks ago.

To answer your question:
Smooth terrain is a cool feature and I'm for it if you can turn it on and off, but I'm against it, if this feature sets the terrain always smooth, because I preffer the cubic worlds. They are simple and cool. :)
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: Smooth voxel surfaces

by MirceaKitsune » Fri May 29, 2015 14:08

RHR wrote:Isn't that already possible if you create a mod if you use mesh nodes? I think I have already seen some smooth terrain screenshots on this forum some weeks ago.

To answer your question:
Smooth terrain is a cool feature and I'm for it if you can turn it on and off, but I'm against it, if this feature sets the terrain always smooth, because I preffer the cubic worlds. They are simple and cool. :)


Using mesh nodes can act as a workaround at best. It is however not optimal, and can offer limited results and likely much worse performance than properly coding the feature.
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: Smooth voxel surfaces

by ABJ » Fri May 29, 2015 15:52

If if if if if if if if if if if if if
I will stay with Minetest.
If if if if if if if if if if if if if
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Smooth voxel surfaces

by Krock » Fri May 29, 2015 17:41

The screenshots look good but what if you want to dig a smoothed node? Does it return 1 or 0 nodes?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: Smooth voxel surfaces

by MirceaKitsune » Fri May 29, 2015 18:05

Krock wrote:The screenshots look good but what if you want to dig a smoothed node? Does it return 1 or 0 nodes?


Gameplay and other functionality shouldn't change. The only things that should are the visual mesh, as well as collisions and physics to represent it.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Smooth voxel surfaces

by prestidigitator » Fri May 29, 2015 19:48

Terasology has the notion of a node family, which is a set of nodes that are basically considered the same, except that they can have different shapes based on how they are created/placed. In fact for your basic node, you can instance it with any defined shape in the game. Being able to load "stone" with shape "stairs" beats the hell out of explicitly having to register every combination of materials and shapes possible ("wood_stairs", "stone_stairs", "desert_stone_stairs", etc.). That could be a first step toward smoothing that doesn't require changing tons and tons about the very basic pieces of the engine such as collisions, rendering, etc.
 

BobbyBonsaimind
Member
 
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

Re: Smooth voxel surfaces

by BobbyBonsaimind » Fri May 29, 2015 20:49

Shameless plug for the ramp utility I wrote some time ago.

Yes, I know that's not what you mean, but my idea behind the ramps utility was a very similar one. However, you could use something like the marching cubes for a similar effect, using prepares meshes and positioning them accordingly.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: Smooth voxel surfaces

by MirceaKitsune » Fri May 29, 2015 23:09

BobbyBonsaimind wrote:Yes, I know that's not what you mean, but my idea behind the ramps utility was a very similar one. However, you could use something like the marching cubes for a similar effect, using prepares meshes and positioning them accordingly.


That looks very nice! But I assume it's done via mesh nodes, no changes to the rendering code?
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Smooth voxel surfaces

by philipbenr » Sat May 30, 2015 01:38

RHR wrote:Isn't that already possible if you create a mod if you use mesh nodes? I think I have already seen some smooth terrain screenshots on this forum some weeks ago.

To answer your question:
Smooth terrain is a cool feature and I'm for it if you can turn it on and off, but I'm against it, if this feature sets the terrain always smooth, because I preffer the cubic worlds. They are simple and cool. :)


No, it doesn't work with meshnodes. I tried it, and there is no smooth lighting with them. If there was, then I would be a lot more excited about them... See my most recent post in the post you screenshots thread.
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Smooth voxel surfaces

by RHR » Sat May 30, 2015 08:44

BobbyBonsaimind wrote:Shameless plug for the ramp utility I wrote some time ago.
Yes, I know that's not what you mean, but my idea behind the ramps utility was a very similar one. However, you could use something like the marching cubes for a similar effect, using prepares meshes and positioning them accordingly.

Yay this was the thread I was looking for! :)

philipbenr wrote:No, it doesn't work with meshnodes. I tried it, and there is no smooth lighting with them. If there was, then I would be a lot more excited about them... See my most recent post in the post you screenshots thread.

I know, but my idea was thought more as a workaround instead of a full working new drawing typ or whatever. ^^
 

BobbyBonsaimind
Member
 
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

Re: Smooth voxel surfaces

by BobbyBonsaimind » Sat May 30, 2015 09:14

MirceaKitsune wrote:That looks very nice! But I assume it's done via mesh nodes, no changes to the rendering code?


Exactly, it consists of three nodes, the ramp itself and the inner and outer corner. All three are rotated as needed, placement is rather simple, based on a mask it is decided which node needs to be placed.

I think mesh nodes are quite suitable for this. All you need is a set of pre-made meshes, like in the marching cubes or marching tetrahedras, or you could always come up with your own set. Placing them is not costly at all if you use VoxelManip object, the only part I had problems with was the rotation (I'm kinda ashamed that it took me several hours until I figured the rotation system out). There are also other systems for creating surfaces from a pre-defined set of parts, mostly they fall in the category of "creating watertight surfaces from voxel data" or some such, but for the life of me I can't remember their names.

You can always look into the worldgen-utils mod to see how I've done it, though, it isn't exactly easy to read, sorry for that. There's also the utils mod, which contains several utility classes to make certain tasks easier.
 

User avatar
Dopium
Member
 
Posts: 233
Joined: Sat Jun 09, 2012 15:43

Re: Smooth voxel surfaces

by Dopium » Sat May 30, 2015 09:48

Great work, has potential as a sub game.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 8 guests

cron