CMS may be a dead, obsolete mesh format, but with some modifications it could be more powerful than ever before. First, I'll address the limitations of CMS and how it could be improved.
1. Low resolution.
It doesn't make much sense to me to have an octaves setting in a CMS file when the mesh it generates is too low-res for it to have much of an effect. So, in addition to the octaves setting, there should be an optional line that tells Celestia how high-res of a sphere you want it to start with when generating the model.
Code: Select all
Subdivisions 6
Octaves 10
2. Pole-pinch artifacts.
Near the poles of a CMS model, the geometry is pinched, apparently because Celestia starts out with a long/lat sphere. Using an octahedron-based sphere (like Blender's icospheres) should fix this.
3. Little control over the overall shapes.
Going off of the code in a CMS model, Celestia uses something like Perlin noise to displace the base sphere. This can be controlled somewhat by changing the height and noise offset parameters, but you're still left with a random mesh. The answer? Using height maps and customizable noise to generate the mesh. The noise and height map can have different amplitudes, allowing for more control over the result. A sea level parameter flattens all terrain below a certain level between 1 and 0. Higher values flatten more of the terrain, lower values flatten less.
There are two base types of noise that can be used, but for the sake of speed only one noise may be used per model: ridged and smooth.
Smooth
Ridged
Noise can also be scaled up or down, on various axes. Scale 2 would result in a noise with features twice the size of the default, while Scale [ 0.5 2 0.5 ] would generate a noise half the size of the default, but flattened on the y axis.
For example, here's a CMS2 file that would generate a planet with both random, ridged terrain and an external height map.
Code: Select all
SphereDisplacementMesh
{
Size [ 1 1 1 ]
Subdivisions 15 #nice amount of detail
Noise {
NoiseType "ridged"
NoiseOffset [ 1 42 23 ]
FeatureHeight 0.002
Octaves 15
Scale 0.25
}
HeightMap {
Texture "marsbump.*"
FeatureHeight 0.005
}
SeaLevel 0.5
}
Edit: fixed smooth perlin image