godot_heightmap_module icon indicating copy to clipboard operation
godot_heightmap_module copied to clipboard

Collisions

Open faculezcano opened this issue 7 years ago • 5 comments

Sorry for feature requesting, but don't get me wrong i'm not requesting features, i just want to help and get involved with this module. Are something about collisions developed? Bullet has its own Heightfield terrain shape that can be requested to godot if it isn't implemented yet, what do you think about this topic?

faculezcano avatar Nov 18 '17 00:11 faculezcano

I used to want to develop it too, but then I discovered @AndreaCatania implemented HeightMapShape in Godot while adding Bullet to the engine, so funnily enough, Godot 3.0 will get heightmap collisions before getting heightmap rendering :D

I am concerned about one detail though, I'm going to implement holes into the terrain (simple masking, not actual caves) so that people can make non-square terrains and place some cave/tunnel models if they want to. BUT... I don't know if Bullet HeightMap collision supports holes too... Found this though http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=3155

Zylann avatar Nov 18 '17 01:11 Zylann

Wow nice! I didn't expect that haha. We have the tools to complete a basic terrain then

faculezcano avatar Nov 18 '17 01:11 faculezcano

Main issues with collisions are:

  • Holes: needs to have a custom version of btHeightfieldTerrainShape apparently
  • Big terrains: the collision object can end up taking a fuckton of memory, I need to test how much. Maybe reduce its resolution, or chunking it too may be needed...
  • Streaming: I don't know how well Bullet would take stitching heightfields as it gets loaded/unloaded (in future evntually)

Zylann avatar Nov 18 '17 01:11 Zylann

@Zylann - I can provide some height maps broken up into tiles to help test very large terrains and the associated performance.

HeadClot avatar Dec 01 '17 23:12 HeadClot

@HeadClot chances are collisions will get implemented without sticking to the graphics. Rendering the terrain has different constraints than collisions, so it will be chunked, but not necessarily the same way (using lower-res and no LOD for example)

Zylann avatar Dec 02 '17 04:12 Zylann