June 21, 2022

Custom Shaders for Gridded Data in Global Mapper

Written by: Mackenzie Mills


Gridded data is a form of raster data containing a single value per pixel, most commonly representing elevation. However, the pixel values in grid data might also represent density, positive or negative change, NDVI, curvature, speed, or any other value interpolated across an area. Regardless of the meaning of the pixel values found in gridded data, the handling of the layers in Global Mapper is the same. These layers can be shown in the 2D and 3D views with the data values represented with a colored shader. Global Mapper’s default shader that you may be familiar with is the Atlas Shader, with colors ranging from blue for lower values to red for higher values.

A point density map created in Global Mapper is gridded data shaded with the default Atlas Shader.

In addition to the Atlas shader, Global Mapper contains a variety of built-in shaders, some of which are designed to interpret non-elevation gridded data. These shaders, like the curvature shader, NDVI shader, and NDWI shader, will automatically be applied when these gridded layers are created through analysis in Global Mapper. Other built-in shaders, like the Atlas shader and gradient shader, are more general in use and may be applied to other types of non-elevation grids. Expanding grid visualization further, Global Mapper also supports the creation of custom shaders through the program’s Configuration options.

When a curvature grid is calculated from a digital elevation model in Global Mapper, a built-in curvature shader is automatically applied.

Designing a Custom Shader

A specific data layer or desired visualization of gridded data is usually the driver behind the creation of a new custom shader. Custom shaders designed to show coastal terrain will likely use different colors and values than those intended to represent wind speed or positive/negative change. 

To create a custom shader in Global Mapper,. give the shader a name and enter threshold values one at a time selecting a color for each entered value. In the Custom Shader dialog box, a preview of the color ramp will be updated as edits are made to the entered values and colors. 

Defaulting to meters or feet, the units noted in the custom shader dialog may not be the true units for the values represented in the grid. A legend in Global Mapper can be customized and displayed to reflect the true units.

Global Mapper’s built-in shaders blend the colors together to make a shader with smooth color transitions. This option can be applied to custom-created shaders too, with the checkbox option to Blend Colors Between Elevation/Slope Values. Without this option checked, a consistent color will be applied to pixels with values greater than the designed value until the next threshold value is reached.

NDVI is visually categorized using a custom shader created with no color blending.

Another option to consider when creating a custom shader is Scale Shader to Loaded Elevation Values. Enabling this checkbox option allows the custom shader color ramp to be stretched, compressed, and shifted to fit the values of the data displayed in Global Mapper. Essentially, the shader colors are preserved, but the associated values are not, allowing the shader to be applied to different value ranges. Use this option with caution since the assigned colors do not represent specific elevations or values making it difficult to compare layers of gridded data for different geographic areas. For instance, when visualizing a positive/negative difference grid, for which the colors and associated values need to remain static in order for the shader to be effective, a scaled shader is inappropriate.

Whether using a built-in or custom shader, a legend describing the color ramp and grid values is an important addition to the map view. In Global Mapper’s Configuration options, an Elevation Legend tab supports the customization of a shader legend. Typically used for elevation data, the default shader units are either feet or meters, but an option towards the bottom of the setup dialog box allows the unit labels in the legend to be removed or customized.

Options to add a legend title and custom unit are found in Global Mapper’s Configuration options.

Custom shaders are automatically saved and, along with the built-in shaders, will be available for future selection in the Shader dropdown list in the Viewer toolbar. Custom shaders can be edited or deleted from within the Shader Options section of the Configuration dialog box. They can also be shared with other Global Mapper users using the Export/Import User Settings options in the Help menu.

If you would like to explore creating and applying custom grid shaders in Global Mapper, download a 14-day free trial today! If you have any questions, please contact us.

Companies using Blue Marble’s geospatial technology