attempt to generate asteroid using Urho3D
Mesh:
- Generate a subdivided cube or sphere mesh in 1x1x1 bounding box
- Random scale the mesh
- Cut the mesh by random planes. Cut means project the vertices behind the plane onto the plane.
- Displace vertices along normal by noise.
For texturing, there are 2 ways:
- UV mapping (drawback: there will be seams)
- Cut the mesh to two half, use auto_uv_map to generate UV.
- Use Urho3D built-in function GenerateTangents() to generate tangent.
- Triplanar mapping (drawback: the bumpness is not as clear as method 1)
- Modify LitSolid shader to LitSolidTriplanar by referencing internet articles.
Normal map:
- Generate height map by placing some random craters and white noise.
- Port NormalMap-Online shader to c++ to generate normal map from height map.
Used code and textures remain their own license
auto_uv_map(Eigen) for uv mapping generated mesh
FastNoise for noise
NormalMap-Online for generate normal map from height map
spheres for sphere mesh
www.textures.com for some diffuse textures
Normal Mapping for a Triplanar Shader for normal map of triplanar mapping