Skip to content

Heightmap

Lachlan McDonald edited this page May 11, 2022 · 12 revisions

The heightmap shader treats the first layer of voxels as a 2D height-map texture and extrudes upwards to create a 3D volume. The height is determined by the relative luminance of each voxel, which is to say, the brighter the voxel's color the taller the extrusion.

Parameters

Parameter Description
Blur Blurs the height-map by the number of voxels specified. Used to smoothes any noise in the original texture. The default value of 0 does not blur, and values up to 10 increase the blurring and the smoothness of the result.
Auto Balance When 1, the range is remapped according to the selected colors in the palette. When 0, the range is not changed by the palette. See below for more information.
Reverse When 0, the luminance of a voxel determines how far it is extruded. When 1, this is reversed and darker voxels are extruded instead.

Blur

Example of a 'Blur' value of 0 Example of a 'Blur' value of 3
Blur: 0 Blur: 3
Example of a 'Blur' value of 6 Example of a 'Blur' value of 10
Blur: 6 Blur: 10

Auto Balance

Example of a 'Auto Balance' value of 0 Example of a 'Auto Balance' value of 1
Auto Balance: 0 Auto Balance: 1

The heightmap shader uses the relative luminance of a voxel to determine its height. By default, the maximum luminance is white (1.0) and minimum is black (0.0).

The maximum height is determined by the volume size.

For example, if you import a height-map texture that ranges from black (0.0) to 50% grey (0.5), the heightmap shaders can do two things:

  • If Auto Balance is 1 and you select the colors in the palette used by the height-map texture, the shader will treat the colors relatively and calculate a new maximum and minimum ranges for you.
  • If Auto Balance is 0, the shader will treat values absolutely (no changes), meaning the highest point will be 50% of the volume.

If Auto Balance is 1, any unselected colors that were used by the texture are ignored when generating the volume. This can lead to odd results.

Reverse

Example of a 'Reverse' value of 0 Example of a 'Reverse' value of 1
Reverse: 0 Reverse: 1

Examples

Height-map texture Results

Download

View the shaders below or download the latest release:

Clone this wiki locally