Zylann / voxelgame

Voxel world prototype made with Godot Engine
Other
515 stars 84 forks source link

Switching the demo to use Transvoxel #53

Closed radishes closed 4 years ago

radishes commented 6 years ago

I've been running the voxelgame demo project and messing around with it. This is awesome, thank you for publishing it!

Is it possible for me to modify the demo to use smooth Transvoxel rendering? I've been poking around and have not been able to figure out how to do this.

Zylann commented 6 years ago

The transvoxel meshing has no physics at the moment and has no texturing. Also, the data is different from a Minecraft-style demo, but maybe you can tweak it:

Technically, you only need the VoxelProvider to fill the Voxel.CHANNEL_ISOLEVEL channel, where numbers above zero mean "absence of matter" and numbers below zero mean "presence of matter" (or maybe the opposite, I forgot). Currently only CHANNEL_TYPE is filled by the demo (where each voxel maps to a cube type). There is a helper function in VoxelBuffer: set_voxel_iso, which accepts a float.

It's a bit more complex to think in the ISOLEVEL format though, it's easy to get wrong-looking surfaces if the data is badly generated (as it has to be a smooth gradient between air and matter).

I'm not working on voxels at the moment, still busy with other stuff

FreeLikeGNU commented 6 years ago

I compiled your modules and ran this game nicely in Linux (Xubuntu 16.04) great work! I too hope to see your progress on transvoxel!

sjb8100 commented 5 years ago

is TransVoxel the new name for the OpenVoxel implemented in 3.1 mentioned here? "IMPORTANT: Godot 3.1 now integrates OpenSimplex under a very similar API, as a result this module is no longer maintained in Godot 3.1 onwards. " https://github.com/Zylann/godot_opensimplex/commit/f8b93c4fb6766413d7c5f0fc4170388e532055e1

How do you recommend we use this /voxelgame/ repo moving forward? do you plan to update it to the built in voxel solution?

Zylann commented 5 years ago

What was added to Godot 3.1 has nothing to do with voxels or Transvoxel, it only provides an official way to generate simplex noise. Transvoxel is a totally different thing, it's an alternative voxel representation that looks like a smooth surface rather than cubes.

This demo used a custom OpenSimplex module in addition to my voxel module in the past because it was not in the engine, and to simplify things I actually took out the OpenSimplex part, and used a simple heightmap image, because the goal of this demo is to show a simple example of my voxel module. It does not focus on terrain generation in particular, and no longer requires OpenSimplex (there are still a few references to it but they shouldn't be used).

Now that OpenSimplex is officially included in 3.1, I could eventually switch the heightmap back to OpenSimplex to make it a bit more interesting, but it's not really a priority for the time I have at the moment. Transvoxel is still in the module, and although it's has only been an experimental challenge, I should make a simple example scene for it just to show how that works, hence this present issue.

sjb8100 commented 5 years ago

good info. I was looking at doing a area effect graphic that would switch the ground from cube voxels to TransVoxels (looking like smooth terrain) of course the end game is principled bsdf on both. take megascans for the cube voxels and some type of texture array / splat map solution for terrain and bonus if can be saved out at runtime to a heightmap. that I assume is many folks end goal. with that stated...

I did notice that your terrain solution is presently the standard for godot, talks have started about solving it in engine but I am not sure where those talks have stopped.

my biggest priority is to have a smooth terrain that you can dig caves in at runtime and looks nice. bonus if the framework can be ported out the cube voxels and tie in with an open source Minecraft backend like TrueCraft available on GitHub.

I am new to c++ and godot but I am willing to help this repo and others in this regard. I assume an irc channel or typical discord type chat is the best way to connect with the core community of godot?

Zylann commented 4 years ago

The state of Transvoxel hasn't changed since, so this issue basically depends on https://github.com/Zylann/godot_voxel/issues/2. I think it doesn't make sense to have this issue in the demo repository.

@sjb8100 the module supports editable smooth marching cubes terrain now, with LOD too ;)

Zylann commented 4 years ago

The demo now uses transvoxel in res://smooth_terrain/main.tscn.