LYGIA Shader Library

reinhardJodie (lygia/color/tonemap/reinhardJodie)

Photographic Tone Reproduction for Digital Images. http://www.cmap.polytechnique.fr/~peyre/cours/x2005signal/hdr_photographic.pdf

Use:

<vec3|vec4> tonemapReinhardJodie(<vec3|vec4> x)

Check it on Github


#ifndef FNC_TONEMAPREINHARDJODIE
#define FNC_TONEMAPREINHARDJODIE
vec3 tonemapReinhardJodie(const vec3 x) { 
    float l = dot(x, vec3(0.21250175, 0.71537574, 0.07212251));
    vec3 tc = x / (x + 1.0);
    return mix(x / (l + 1.0), tc, tc); 
}
vec4 tonemapReinhardJodie(const vec4 x) { return vec4( tonemapReinhardJodie(x.rgb), x.a ); }
#endif

Dependencies:

Use:

<float3|float4> tonemapReinhardJodie(<float3|float4> x)

Check it on Github




#ifndef FNC_TONEMAPREINHARDJODIE
#define FNC_TONEMAPREINHARDJODIE
float3 tonemapReinhardJodie(const float3 x) { 
    float l = luminance(x);
    float3 tc = x / (x + 1.0);
    return lerp(x / (l + 1.0), tc, tc); 
}
float4 tonemapReinhardJodie(const float4 x) { return float4( tonemapReinhardJodie(x.rgb), x.a ); }
#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.

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