Recent progress has been adding a domain warped noise which is blended with the vertical surfaces so you get jagged slopes and smooth flat areas.
This wasn't high enough resolution so I switched to using 32-bit indices during the generation of the icosahedron meshes.
This wouldn't work elsewhere in the game or for rendering but after welding of duplicate vertices it reduces the number of vertices to less than 65536 which means I can then convert the indices back into Uint16.
That gives me an extra
two levels of subdivision compared to the usual Drawables::Sphere class and a high enough resolution mesh to work with, a neat trick anyway.
There was some experimenting with blending but I've not yet taken a serious look at it.
Collision and integration with the engine proper still needs works but I have done some hacking to experiment with generating the collision information, this leads me to believe that I will need to properly integrate the generated asteroid with the scenegraph rendering system.
In hindsight that's a really obvious idea/statement but it's surprising how long good ideas take to penetrate my mind!
Currently, and in part because of the scenegraph realisation, I am working on a system to easily generate LODs.
Which means that the current order of tasks for the asteroid visuals / collision is something like:
- LOD mesh creation
- SceneGraph integration
- Collision creation & setup
- Integration with AsteroidBody for use in-game (rather than just modelviewer)
- Config file to control textures used and tiling
- Further surface deformation (optional) (Small craters?)
- Decoration eg: additional rocks/boulders on the surface etc (optional)
Something I haven't really touched upon so far is the configuration of the asteroid themselves, as in how we control their appearance beyond just using a random bunch of deformations from a seed value.
There are currently a number of things that can be changed, for example:
- blending used to choose between the surface normal and the sphere normal, bigger asteroids would be more spherical so it would be weighted towards the sphere normal instead of the surface normal like for smaller asteroids.
- deformation amount controls the depth of the deformation, small objects can be deformed much more than big ones.
- deformation radius controls the size of the area affected by each deformation, but does this want to be bigger or smaller depending on the size of the world and how is it constrained or chosen?
...there's others but I can't look at the code right now so can't recall them all :) but there are handles to pull which control various parts of it and lead to either smooth round asteroids or jagged nightmarish tangles.
None of these are exposed yet, nor do they have any guidance for setting their values.
This is all before we start on actually placing them in the game world.
I was hoping that someone might find that interesting, writing the location/information generation stuff for asteroids belts, rings, Trojans and loose wandering bodies etc :/ oh well, I'll just have to get around to it after the rest.
Andy