LYGIA Shader Library

heatmap (lygia/sample/heatmap)

sample a value encoded on a heatmap

Dependencies:

Use:

sampleFlow(<SAMPLER_TYPE> tex, <vec2> st)

Check it on Github



#ifndef SAMPLEHEATMAP_SAMPLE_FNC
#define SAMPLEHEATMAP_SAMPLE_FNC(TEX, UV) SAMPLER_FNC(TEX, UV).rgb
#endif

#ifndef FNC_SAMPLEHEATMAP
#define FNC_SAMPLEHEATMAP
float sampleHeatmap(SAMPLER_TYPE tex, vec2 st) { return rgb2heat( SAMPLEHEATMAP_SAMPLE_FNC(tex, st) ); }
float sampleHeatmap(SAMPLER_TYPE tex, vec2 st, float _min, float _max) { return  _min + sampleHeatmap(tex, st) * (_max - _min); }
#endif

Dependencies:

Use:

sampleFlow(<SAMPLER_TYPE> tex, <float2> st)

Check it on Github



#ifndef SAMPLEHEATMAP_SAMPLE_FNC
#define SAMPLEHEATMAP_SAMPLE_FNC(TEX, UV) SAMPLER_FNC(TEX, UV).rgb
#endif

#ifndef FNC_SAMPLEHEATMAP
#define FNC_SAMPLEHEATMAP
float sampleHeatmap(sampler2D tex, float2 st) { return rgb2heat( SAMPLEHEATMAP_SAMPLE_FNC(tex, st) ); }
float sampleHeatmap(sampler2D tex, float2 st, float _min, float _max) { return  _min + sampleHeatmap(tex, st) * (_max - _min); }
#endif

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