TerraLand Maps Maker – Shadow Removal, Colormap & Landcover (Splatmap) from images
First of all, TerraLand operates on top of Unity’s built-in terrain system, so no special terrain meshes or shaders will be used to create terrains.
Also the MapsMaker component of TerraLand is somehow in its Beta stages and will become more accurate and faster in the future.
The splat layer count can be as much as existing splat layers you want on your terrain. You simply create splat maps using MapsMaker component as single textures including the proper RGBA channels to represent texturing layers and finally replace it with the existing splat map in your terrain data using this simple script put in Editor folder of your project.
This way you can have as many splat layers as you want to have on Unity terrains.
For the color ranges in the splatmap itself, it’s just RGBA as in any splatmaps saved in a Tiff or PNG image file.
For generating layers and filling each channel in splatmap, firstly we need a clean satellite image without any shadows and micro details if there are any for best output. So as the first step in MapsMaker we do the following:
- Insert the original satellite image as the input image to be processed by dragging & dropping it from the Project panel into the Satellite Image field of the MapsMaker UI
- Press “Show Image Display” button to see the inserted image in a new zoom-able window
- Go to the “Shadow Remover” section and select the color picker to define the shadow color & brightness in the satellite image
- In the Satellite Image Viewer window zoom in to the area which has shadows in it and select a shadowed point by the color picker
- There are 2 options of “Shadow Brightness” & “Healing Block Size” which affect the final shadowless image. So playing back and forth with these settings will get you to the best results.
- “Shadow Brightness” changes the selected shadow color’s brightness with a slider to be more controllable. Usually we set it for a bit higher value so that shadowed areas will be detected better.
- “Healing Block Size” is related to the original image’s resolution and defines the healing cell size which needs to be taken from other un-shadowed areas of the image and being stamped on shadowed areas.
- In this case, we leave the 2 settings untouched and press the “Eliminate Shadows” button at the bottom of the UI so that a shadowless image will be created next to the original satellite image.
Shadow Remover Section
Now we head over to the “Colormap Generator” section which is an optional step but becomes useful when the original satellite image has high frequency details and/or many extra details which is not needed to be included in the Splatmap or Landcover image at the end.
The Colormap is also useful for terrain shaders which support colormaps in their inputs as a more accurate map for color mapping from a raw satellite image.
- Insert the previously generated shadowless satellite image as the input image to be processed by dragging & dropping it from the Project panel into the Satellite Image field of the MapsMaker UI
- Playing back and forth with the 3 provided settings of “Erosion Radius”, “Smoothness” & “Sharpness” will get us to the best results.
- “Erosion Radius” is the size of pixels in each Erosion operation throughout the whole image in order to remove the smaller details and colors in the image.
- “Smoothness” is the value to define the attack of the surrounding Erosion cells to achieve a soft or hard falloff between eroded areas.
- “Sharpness” sets the sharpness of the final eroded result to bring back bigger washed away details in the image.
- In this case, we leave the 3 settings untouched and press the “Generate Colormap” button at the bottom of the UI so that a colormap image will be created next to the inserted shadowless satellite image.
Colormap Generator Section
And finally we get to the point to have a proper Splatmap/Lancover image out of our original satellite image as follows:
- Insert the previously generated colormap image as the input image to be processed by dragging & dropping it from the Project panel into the Satellite Image field of the MapsMaker UI
- Select the output format of the generating Splatmap between PNG & Tiff
- “Map Smoothness” is the value to define the attack of the surrounding color range cells to achieve a soft or hard falloff between detected color range areas.
- When “Automatic Mode” is on, the MapsMaker will automatically detect top used colors in the inserted satellite image by the help of “Color Damping” & “Filter Radius” values in the settings and set the layers. When this option is turned off, the user have to manually set a Color, its Output Channel and its Radius for each layer in the splatmap.
- “Filters Count” define the total number of colors to be taken and fill in the 4 layers of Red, Green, Blue & Alpha channels in the final splatmap. The values above 4 indicates that each RGBA layer can potentially have more than 1 color in it. For example if the Filters Count value is set to 5 and the “Output Ordering” is set to “Sequential”, the Red channel of the splatmap can hold 2 colors from the image while the other 3 channels only represent 1 color in them.
- “Color Damping” defines the damping between detected/selected colors in the splatmap where they can be blended with each other.
- “Filter Radius” is the pixel size for each generation cell to finally create a seamless splatmap image.
- “Output Ordering” defines whether the layers have to be filled in a sequential ordering or as soon as their colors are detected. This option does not affect the final quality or shape of the generating layers in the splatmap and it’s there as an optional preview setting.
- When you set the “Automatic Mode” on and finished setting up the parameters, you should press “Generate Filters” button so that MapsMaker will analyse satellite image and detect top colors in it to be used in the final splatmap layers.
- Finally by pressing the “Generate Splatmap” button, MapsMaker start to generate the Splatmap/Landcover image out of your inserted satellite image.