Thisis the heightmap we will be using. First, you have a blank part of your heightmap which will look like a flat surface in game. We certainly do not want this because it stands out, even after applying PQSMods
What we do is we copy the image into photoshop. Use ctrl + v to paste the image into a new layer. Press Ctrl + T to transform the image. Rotate it into a good looking orientation. Depending on however you wish to blend the seams of the heightmap, merge the layer down to the heightmap. Make sure you are not using indexed. At the top, go to image > mode > RGB.
Then merge the seams by using any preferred technique. This includes simply rubbing out the edges, blurring the edges into the surrounding heightmap, content aware, heal tool or any other method of removing jagged edges.
1. Grab you texture in your image editing program. Here we have a horrible photo from NASA's archives that won't suit a planetary texture but it will suit the purposes for demonstration of this technique. This texture currently does not wrap well around a cylinder as we will see shortly.
3. In the horizontal input, type in the half-width value of your image. For example, this texture is 2048px wide, so I have entered 1024 to offset/wrapped around the image horizontally by half. Here you can see how apparent the fact that the image is not horizontally tile-able as we have the stark contrast of the edges of the texture not meeting up in a nice fashion. If the texture was wrapped onto a sphere in this state you would see the highly visible texture seam running from the North to Sole pole.
1. Grab you texture in your image editing program. For this example I am using the horrid texture that I demonstrated the Horizontal Tiling process on as it will suit the purposes for demonstration of this technique. When wrapped around a sphere this texture will currently not look very pretty at the polar regions as we will see shortly.
4. Here you can see what the texture would look like on the North Pole if it were wrapped around a sphere; you can tell that the texture is not set up to be spherically wrapped as there is a lot of distortion around the top. This is what is commonly referred to as 'Polar Pinching'.
5. Use all your Photoshop/GIMP/Paint.net etc. skills to remove the distortion and get the center of the image looking nice. Try not to affect much of the texture as it falls towards the outer edges too much, keep your healing towards the center where the predominant distortion is occurring.
8. Here you have distorted the image back to its rectangular format and you can see your polar wrapping occurring at the top of the texture. Now onto fixing the South pole. Flip your texture vertically by selecting Image > Image Rotation > Flip Canvas Vertical.
14. There we have it, the finished article. Here you can see at the top and bottom of the texture the spherical warping as you are trying to represent a spherical mesh on a rectangular net. Using this texture in game around a planet/moon, it would no longer have distortions or pinching at its North and South poles.
15. Save this final texture as a new image and Copy > Paste it over your Master Copy texture before you started this Polar Pinching Removal process. Feather the top and bottom of the newly distorted image into your existing Master Copy texture image. The reason behind this is that when applying the Polar Distortion filter to an image, you are inducing compression into the texture that, when doing the reverse distortion (to get the texture back to an equirectangular format), you will end up with a texture map that has blurring and artifacts appearing on it. To get around this issue, save you map before hand, do the Polar Distortion Removal process and save the result as a new texture. Copy this new texture over your Master Copy and then feather the pasted, distorted map back into the Master Copy map.
By doing this, you will limit the amount of compression you are inducing into your map textures to only the polar regions.This is a side by side, before and after, comparison of the compression of a 4k x 2k map that has been run through the Polar Distortion filter at a 800% zoom to show the result on the pixel level... look at all that horrible compression!
Please Note: This finished texture would be pretty terrible to use in-game as it features a heavily directional light source (see shadows/highlights in the craters). It should also be known that it is good practice to generate your colour/albedo maps directly from your post PQS heightmap (i.e. heightmap with the PQS baked in), as this way, you will not be inducing any directional lighting from any references images you use.
Unfortunately, a lot of planet packs that have ocean worlds have very little surface topography below sea level other than rolling plains of small undulating noise. This is pretty boring and doesn't represent what typical land formations would look like underwater. Here we can try to apply some work to get a more 'realistic' form of underwater topography that should be interesting to explore.
So we start with your heightmap in Wilbur. Load it up and if you toggle the Texture > Greyscale Bump Shader it should look directly like your heightmap. Please ignore the above sea level landmasses (in general) as they were just quick lumps of dirt I added to give the oceans a basis to work from.
If you enable the default Texture > Wilbur Shader it will be much easier to work with as the Sea to Land transition is easily recognizable. Adjust your base map so that the coastline is located at the right altitude and then set the 'Below Sea Level' and 'Above Sea Level' spans to their correct altitudes respectively. Use Filter > Math > Offset to adjust your base map up or down (in meters) so that your coastline is set correctly and then use Select > From Terrain > Height Range and select all the area below sea level i.e. Min Height -5000m (some low number) Max Height 0m, then apply Filter > Math > Span and set the selection to your desired height range. Do the same with the area above sea level i.e. Min Height 0m Max Height +5000m (some big number) and then apply Filter > Math > Span and set your desired altitude range above sea level. You should get something similar to the image above. Note that the ocean looks flat because we do not have any varying topography on the ocean regions (which is the whole point of this tutorial).
Choose a Minimum Height of 0m and a Maximum Height of an altitude such as -1000m. The Noise box allows you to apply some random noise during the application. Also, tick 'Use Fractal Parameters' which allows the Mound function to also work from a Spherical Noise based profile. You can mess around with these noise parameters to your heart's content, I have shown a suggested setup.
Hit 'OK' and the Mound function will fill in the whole selected region with new terrain. What this function is doing here is adding shallow terrain near the land coastlines at 0m and lerping it out towards the areas furthest away from land, down to a very low altitude that you set in the function. Neat, eh?
Currently, the terrain below Sea Level is pretty uniform and smooth which looks weird. With the areas below Sea Level still selected, we can apply Spherical Noise functions on the terrain to give it more randomness. Apply Filter > Noise > Spherical Fractal Noise.
Here you can choose the Noise Type and Operation, for this pass I chose to use RidgedMultiFractal (pretty common noise function used in terrain generation) and the Multiply operation so that it will affect my existing terrain by a factor of the noise function.
Following that application of noise, I then applied another Filter > Math > Exponent function, opposite to my earlier one, in which I applied a >1 factor to give the coasts a more gradual descent into the depths. This was just to adjust the underwater terrain to my liking.
Then we can start detailing the underwater terrain. Here I made a Select > From Terrain > Height Range selection of all the terrain below sea level up to about +50m. Then I applied a Filter > Morphological > Erode function a few times to simulation some typical and general erosion on the topography.
Ensure you change the Wrap drop-down to X-Only so that the erosion simulation wraps between the left and right sides of the map. The Passes value dictates how many iterations of the simulation you wish to run. NOTE! This filter application takes a LONG time to run dependent on the size of your maps.
When you zoom in close you can see the additional detail here as to what is going on. Just as in reality, you can see here that at specific altitudes, the terrain drops off sharply to simulate shelving.
Here is the resultant height map. See how different it looks in comparison to the original. Please note that this whole application of the tutorial works more effectively when you have complex, larger landmasses on your map.
The map above is a height map created by our fellow forum user @Beale, who shared it with me whilst discussing terrain generation. As stated at the start of this tutorial, like most other created Ocean Worlds, it did not have any considerable terrain below sea level.
Again we can apply our knowledge to create some interesting underwater terrain. Please note that at the North/South Ice Caps you'd want to do some further editing to ensure that the land DOES NOT slope down gradually at the ice cap borders. Due to KSP's limitations with its PQS system and concave meshes, it's usually best to have a sudden vertical cliff from the depths up to 0m at the border (you cannot go under the ice).
Gaseous Giganticus is a utility program created by Stephen M. Cameron for the usage in his game Space-Nerds-In-Space that uses Curl Noise to simulate Procedural Fluid Flow by simulating the curl of the gradient of a noise field to produce a chaotic but divergence free velocity field, dumping a bunch of particles initially colored according to input image and then moving those particles around according to velocity field and rendering the output image... then iterate over and over. By doing this on a spherical noise field representations of gas giants can be created with great success.
3a8082e126