Loading shader
Slow-moving topographic contour lines with highlighted index lines; the pointer raises a hill under itself.
lines, moderate, MIT, v1.0.0
This is the code for the shader exactly as it is set above. It updates as you change the controls.
Props of the ContourField React component. The JavaScript version takes the same names in its settings object.
| Prop | Type | Default | Description |
|---|---|---|---|
| colors | [string, string, string] | ["#0c0f14", "#2f3946", "#d9a85a"] | Background, Lines, Index lines. Hex colours. |
| speed | number | 1 | Speed. Range 0 to 3. |
| scale | number | 1.6 | How much terrain is in view. Higher shows more, smaller features. Range 0.8 to 6. |
| intensity | number | 1 | Line thickness in pixels. Range 0.4 to 3. |
| seed | number | 31 | Seed. Range 0 to 999. |
| levels | number | 18 | Number of contour levels across the height range. Range 6 to 48. |
| paused | boolean | false | Freeze the animation on the current frame. |
| maxDpr | number | 2 | Upper bound for devicePixelRatio. Lower it to save GPU time. |
| className | string | none | Classes for the canvas, for example to position it. |
| style | CSSProperties | none | Inline styles for the canvas. |
Moderate. Cost 2 of 3.
Layered noise per pixel. Fine full-screen on recent phones and laptops; on weak GPUs the resolution steps down automatically.