lygia
/color
/tonemap
)Tone maps the specified RGB color (meaning convert from HDR to LDR) inside the range [0..~8] to [0..1]. The input must be in linear HDR pre-exposed.
Dependencies:
lygia
/color
/tonemap
/aces
.glsl
lygia
/color
/tonemap
/debug
.glsl
lygia
/color
/tonemap
/filmic
.glsl
lygia
/color
/tonemap
/linear
.glsl
lygia
/color
/tonemap
/reinhard
.glsl
lygia
/color
/tonemap
/reinhardJodie
.glsl
lygia
/color
/tonemap
/uncharted
.glsl
lygia
/color
/tonemap
/uncharted2
.glsl
lygia
/color
/tonemap
/unreal
.glsl
Use:
tonemap(<vec3|vec4> rgb)
#ifndef TONEMAP_FNC
#if defined(TARGET_MOBILE) || defined(PLATFORM_RPI)
#define TONEMAP_FNC tonemapUnreal
#else
// #define TONEMAP_FNC tonemapDebug
// #define TONEMAP_FNC tonemapFilmic
// #define TONEMAP_FNC tonemapACES
// #define TONEMAP_FNC tonemapUncharted2
// #define TONEMAP_FNC tonemapUncharted
#define TONEMAP_FNC tonemapReinhardJodie
// #define TONEMAP_FNC tonemapReinhard
// #define TONEMAP_FNC tonemapUnreal
// #define TONEMAP_FNC tonemapLinear
#endif
#endif
#ifndef FNC_TONEMAP
#define FNC_TONEMAP
vec3 tonemap(const vec3 v) { return TONEMAP_FNC(v); }
vec4 tonemap(const vec4 v) { return TONEMAP_FNC(v); }
#endif
Dependencies:
lygia
/color
/tonemap
/aces
.glsl
lygia
/color
/tonemap
/debug
.glsl
lygia
/color
/tonemap
/linear
.glsl
lygia
/color
/tonemap
/reinhard
.glsl
lygia
/color
/tonemap
/uncharted
.glsl
lygia
/color
/tonemap
/unreal
.glsl
lygia
/color
/tonemap
/aces
.glsl
lygia
/color
/tonemap
/debug
.glsl
lygia
/color
/tonemap
/filmic
.glsl
lygia
/color
/tonemap
/linear
.glsl
lygia
/color
/tonemap
/reinhard
.glsl
lygia
/color
/tonemap
/reinhardJodie
.glsl
lygia
/color
/tonemap
/uncharted
.glsl
lygia
/color
/tonemap
/uncharted2
.glsl
lygia
/color
/tonemap
/unreal
.glsl
Use:
tonemap(<float3|float4> rgb)
#ifndef TONEMAP_FNC
#if defined(TARGET_MOBILE) || defined(PLATFORM_RPI) || defined(PLATFORM_WEBGL)
#define TONEMAP_FNC tonemapUnreal
#else
// #define TONEMAP_FNC tonemapDebug
// #define TONEMAP_FNC tonemapFilmic
// #define TONEMAP_FNC tonemapACES
// #define TONEMAP_FNC tonemapUncharted2
// #define TONEMAP_FNC tonemapUncharted
#define TONEMAP_FNC tonemapReinhardJodie
// #define TONEMAP_FNC tonemapReinhard
// #define TONEMAP_FNC tonemapUnreal
// #define TONEMAP_FNC tonemapLinear
#endif
#endif
#ifndef FNC_TONEMAP
#define FNC_TONEMAP
float3 tonemap(const float3 color) { return TONEMAP_FNC(color); }
float4 tonemap(const float4 color) { return TONEMAP_FNC(color); }
#endif
Dependencies:
lygia
/color
/tonemap
/aces
.glsl
lygia
/color
/tonemap
/debug
.glsl
lygia
/color
/tonemap
/filmic
.glsl
lygia
/color
/tonemap
/linear
.glsl
lygia
/color
/tonemap
/reinhard
.glsl
lygia
/color
/tonemap
/reinhardJodie
.glsl
lygia
/color
/tonemap
/uncharted
.glsl
lygia
/color
/tonemap
/uncharted2
.glsl
lygia
/color
/tonemap
/unreal
.glsl
Use:
tonemap(<float3|float4> rgb)
#ifndef TONEMAP_FNC
#if defined(TARGET_MOBILE) || defined(PLATFORM_RPI)
#define TONEMAP_FNC tonemapUnreal
#else
// #define TONEMAP_FNC tonemapDebug
// #define TONEMAP_FNC tonemapFilmic
// #define TONEMAP_FNC tonemapACES
// #define TONEMAP_FNC tonemapUncharted2
// #define TONEMAP_FNC tonemapUncharted
#define TONEMAP_FNC tonemapReinhardJodie
// #define TONEMAP_FNC tonemapReinhard
// #define TONEMAP_FNC tonemapUnreal
// #define TONEMAP_FNC tonemapLinear
#endif
#endif
#ifndef FNC_TONEMAP
#define FNC_TONEMAP
float3 tonemap(const float3 v) { return TONEMAP_FNC(v); }
float4 tonemap(const float4 v) { return TONEMAP_FNC(v); }
#endif
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.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository