DEFINE_SHADER

The DEFINE_SHADER command allows a custom elevation / slope shader to be defined to be used when rendering gridded elevation data. The shader will then be available for any other operations and later Global Mapper runs. If there is an existing custom shader with the same name it will be replaced.

The DEFINE_SHADER command consists of a single command line followed by a series of lines describing the series of elevation / slope and color pairs that define the shader. Each line should have a single elevation / slope value and a color value separated by a comma.

The DEFINE_SHADER command is terminated with a single line containing only the text END_DEFINE_SHADER.

The following parameters are required by the DEFINE_SHADER command.

  • SHADER_NAME - specifies the name to associate with the shader
  • BLEND_COLORS - specifies whether or not colors should smoothly blend between values. Use BLEND_COLORS=NO to disable blending beween colors so you only get exactly the specified color.
  • STRETCH_TO_RANGE - specifies whether or not the specified elevation values for the shader should stretch to the range of the loaded data. Use STRETCH_TO_RANGE=YES to enable.
  • SHADE_SLOPES - specifies whether the elevation/slope values are slopes in degrees or elevation values. Use SHADE_SLOPES=YES to indicate the specified values are slopes.
  • SLOPES_PERCENT - specifies whether the slope values that are specified. Add SLOPES_PERCENT=YES to indicate that slopes are in percent, otherwise they will be in degrees.
  • OVERWRITE_EXISTING - specifies what to do if there is already a custom shader with the given name If OVERWRITE_EXISTING=YES is specified the existing custom shader will be overwritten. Otherwise it would be ignored.
  • SAVE_SHADER - specifies whether or not the shader should be saved between runs via the custom_shaders.txt file. This is enabled by default, so add SAVE_SHADER=NO to cause your shader to NOT be remembered.

SAMPLE

Here is an example of a DEFINE_SHADER command used to define a sample 3-color blended shader.

 DEFINE_SHADER SHADER_NAME="Script Shader" BLEND_COLORS=YES STRETCH_TO_RANGE=YES SHADE_SLOPES=NO
 0.0,RGB(255,0,0)
 20.0,RGB(0,255,0)
 50.0,RGB(0,0,255)
END_DEFINE_SHADER