LYGIA Shader Library

heatmap (lygia/color/palette/heatmap)

Heatmap palette

Use:

<vec3> heatmap(<float> value)

Check it on Github


#ifndef FNC_HEATMAP
#define FNC_HEATMAP
vec3 heatmap(float v) {
    vec3 r = v * 2.1 - vec3(1.8, 1.14, 0.3);
    return 1.0 - r * r;
}
#endif

Use:

<float3> heatmap(<float> value)

Check it on Github


#ifndef FNC_HEATMAP
#define FNC_HEATMAP
float3 heatmap(float v) {
    float3 r = v * 2.1 - float3(1.8, 1.14, 0.3);
    return 1.0 - r * r;
}
#endif

Check it on Github


fn heatmap(v: f32) -> vec3f{
    let r = v * 2.1 - vec3f(1.8, 1.14, 0.3);
    return 1.0 - r * r;
}

Dependencies:

Use:

<float3> heatmap(<float> value)

Check it on Github



#ifndef FNC_HEATMAP
#define FNC_HEATMAP

inline __host__ __device__ float3 heatmap(float v) {
    float3 r = v * 2.1 - make_float3(1.8f, 1.14f, 0.3f);
    return 1.0 - r * r;
}

#endif

Examples

Licenses

LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.

Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).

It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.

Get the latest news and releases

Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository