GameFoundry / bsf

Modern C++14 library for the development of real-time graphical applications
https://www.bsframework.io
MIT License
1.73k stars 194 forks source link

Terrain system #16

Open BearishSun opened 6 years ago

BearishSun commented 6 years ago

Heightmap based terrain system with continuous level of detail. Texture splatting and detail textures. Ability to remove chunks so that it can be integrated with custom 3D models. Ability to use displacement mapping (tesselation) for fine grained details on the surface (e.g. rocks, grooves, etc.).

Terrain vegetation system:

Water rendering shader.

Likely for a later feature: Separate voxel based terrain system (or a generic voxel based system)

iontom commented 6 years ago

marching cubes look pretty nice: https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/

There's a pretty cool implementation for a module in Unreal that is MIT license, for following the patterns there. https://github.com/Phyronnaz/VoxelPlugin

BearishSun commented 6 years ago

Thanks, always nice to have an existing implementation as a starting point.

christianclavet commented 6 years ago

We could have a voxel terrain to model, then use the voxels to generate a mesh. Using a voxel model to start with would give use total control over how the geometry is done (caves, etc.)

Could be something like this plugin for unity (Perhaps there is a way to "plug" it with Banshee. This is more than just terrain, it come with a vegetation system, and water systems... V11 https://youtu.be/xS2b6qibmJc

V10 https://youtu.be/S9q3uxyunyo

Tools https://youtu.be/51JNyjBcDMo https://forum.unity.com/threads/terrainengine-voxel-terrain-smooth-cubic-2d-hexagonal-infinite-procedural-terrain.174595/

Edit: The technique utilized here is based on Transvoxels: http://transvoxel.org/

The plugin mentioned by IONTOM is also based on transvoxel so definitively a good starting point!

jonesmz commented 6 years ago

@BearishSun Several of the people who've been making noise with the Banshee engine / bsf lately (including myself) are trying to collaborate on a game that we're currently calling "Open Space Program" where a major feature is going to be launching virtual rockets from the surface of a planet, and landing on other bodies in a solar system.

We're still trying to find an engine that we think fits our needs the most. I'm a big fan of Banshee because of how clean and modern the codebase is.

One of our collaborators is evaluating Urho3d and tinkering how one would go about making a planet renderer, with their WIP code here: https://github.com/TheOpenSpaceProgram/urho-osp

So long story short, if the terrain system, at the worst, doesn't make it impossible to render a planet with Banshee, that'd be super :-)

BearishSun commented 6 years ago

@christianclavet When voxel painting is added I'll certainly add a way to bake it into a proper mesh. That's how Cryengine handles cave creation and it feels quite natural.

With a bit more features I'm sure many of these Unity plugins could be adapted to Banshee. But from personal experience with Unity plugins, and from the provided video, it seems like quite a performance intensive task. Likely because it needs to be done non-optimally using the scripting interface, rather than being a core part of the engine. So in Banshee I'd like it to be part of the core.

@jonesmz That sounds really nice. If you do decide on Banshee I'd love to offer any help I can, including moving the terrain system further up the priority list. A simple geomipmapped terrain system like Urho3D has can probably be whipped up pretty fast, and we can improve it from there.

If you do go with Urho3D I'd be wary of its single-threaded nature. I feel with procedural worlds it's going to be very important to do rendering on a separate thread, especially when you increase the scope of the project. Also an API like Vulkan can help even more by further reducing the CPU load.

equalent commented 5 years ago

Hello! Is there any progress on the terrain system?

Best, Andrey

BearishSun commented 5 years ago

No progress yet. This feature is planned for v1.3, while I'm currently in the process of finishing up v1.1.

equalent commented 5 years ago

Oh, I see. Anyways, thank you, Marko.

Best, Andrey