WazWaz / EnvironmentalVisualEnhancements

Visual enhancements including clouds, lights, etc.
71 stars 21 forks source link

Properly scale the clouds in modified main menus #12

Closed StollD closed 6 years ago

StollD commented 6 years ago

If you replace the body in the main menu using Kopernicus, the scale of the clouds is messed up for bodies that don't have the same size as Kerbin.

For example Eve, which is bigger than Kerbin, has it's clouds floating multiple kilometers above the planet model, while Laythe's clouds are completely missing, since Laythe is smaller than Kerbin. The reason for this is, that Kopernicus has to rescale the bodies in the main menu to match the exact size of Kerbin. (i.e. a radius of 600000m or 100 scaled space units).

Since EVE cannot really know which body is represented in the main menu, it always assumes the scale of Kerbin for the clouds. However, in combination with using the (changed) planet radius this seems to causes the described bug.

The solution I came up with is to change the hardcoded Kerbin scale to a dynamically calculated scale in the main menu. This yields the same results for Kerbin, and accurate results for every other body.