Jux Reference (deprecated version)
From Picogen-doc
Contents |
Abstract
Height-Slang is a language for the definition of heightmaps [1].It is used in mkheightmap, itself being a powerfull tool (a part of the puzzle of picogen [2]) to generate heightmaps on the command-line.
This article is based on a transcription of [3].
Height-Slang Reference
The next sections show the currently supported instructions of height-slang, following this convention:
- A greek letter (α, β, γ, etc.) indicates an arbitrary expression
- Each item looks like
or
Note that there is only one data type in Height-Slang: real. This means we have to introduce kludges to anyway be able to solve boolean expressions:
- A real-value α is considered true, if and only if
, else it is considered false
This rule applies to the first parameter of the "?"-function, and to any parameter of the logical functions "and", "or", "xor", "not". Additionally, a value of either 1.0 (true) or 0.0 (false) is returned by the
comparison functions, so they can safely be used for the "?"-function as the first parameter, but also as a "on/off"-factor in general expressions (that leads to a kind of branch free code).
Comparison Functions
Name | Syntax | picogen-version |
---|---|---|
Less-Than | ![]() | 0.1 |
Less-Or-Equal | ![]() | 0.1 |
Greater-Than | ![]() | 0.1 |
Greater-Or-Equal | ![]() | 0.1 |
Equal | ![]() | 0.1 |
Not-Equal | ![]() | 0.1 |
Basic Arithmetics
Name | Syntax | picogen-version |
---|---|---|
Addition | ![]() | 0.1 |
Subtraction | ![]() | 0.1 |
Multiplication | ![]() | 0.1 |
Division | ![]() | 0.1 |
Power | ![]() | 0.1 |
Functions With One Parameter
Name | Syntax | picogen-version |
---|---|---|
Inverse | ![]() | 0.1 |
Sine | ![]() | 0.1 |
Cosine | ![]() | 0.2 (actually 0.1, but it had a bug then) |
Floor | ![]() | 0.1 |
Absolute | ![]() | 0.1 |
Truncate | ![]() | 0.1 |
Fractional | ![]() | 0.1 |
Negate | ![]() | 0.1 |
Square-Root | ![]() | 0.1 |
Logical Not | ![]() | 0.1 |
Functions With Two Parameters
Name | Syntax | picogen-version |
---|---|---|
Logical And | ![]() | 0.1 |
Logical Or | ![]() | 0.1 |
Logical Xor | ![]() | 0.1 |
Min (Minimum) | ![]() | 0.2 |
Max (Maximum) | ![]() | 0.2 |
Delta | ![]() | 0.2 |
Functions With Three Parameters
Name | Syntax | picogen-version |
---|---|---|
If-Then-Else | ![]() | 0.1 |
Linear Interpolation | ![]() | 0.1 |
Configurable Functions
LayeredNoise
([2 LayeredNoise seed(<positive integer>) <default: 42> frequency(<real number>) <default: 2.0> layercount(<positive integer>) <default: 4> filter(<nearest|bilinear|cosine>) <default: nearest> persistence(<1-dimensional HS expression>) <default: 0.5> levelEvaluationFunction(<1-dimensional HS expression>)) <default: x> ] parameter_a parameter_b )
Noise
(new in picogen 0.2)
([2 Noise seed(<positive integer>) <default: 42> frequency(<real number> <default: 2.0> filter(<nearest|bilinear|cosine>) <default: nearest> ] parameter_a parameter_b )
Layers
(new in picogen 0.2)
([2 Layers base(<base-function>) <default: ([2 Noise] xy) > frequency(<real number>) <default: 2.0> layercount(<positive integer>) <default: 4> persistence(<1-dimensional HS expression>) <default: 0.5> levelEvaluationFunction(<1-dimensional HS expression>)) <default: x> ] parameter_a parameter_b )