โ† All examples

godot shaders

Topographic contour lines with elevation tints

Map-style shading by world height: minor and major contour lines of constant pixel width every few metres, hypsometric colour bands from lowland green to highland brown and white, on any mesh.

Recorded render of Topographic contour lines with elevation tints

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • preview.png
  • test_package.py
  • topographic_contours.gdshader
  • verification/native.json

How it works

Shader type
spatial
Parameters
interval (float = 0.1), major_every (int = 5), line_pixels (float = 1), line_color (vec4 = 0.35, 0.22, 0.12, 1), height_low (float = -0.5), height_high (float = 0.6), low_tint (vec4 = 0.55, 0.75, 0.5, 1), mid_tint (vec4 = 0.9, 0.85, 0.6, 1) and 2 more
Result
Hills shaded in green, sand and brown bands with brown contour rings that thicken every fifth line.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/topographic_contours/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

On flat areas exactly at a contour height the line covers the whole surface. Lines on near-vertical walls bunch together. Heights are world Y, so the material must not move vertically to keep the map stable.