LYGIA Shader Library

reinhard (lygia/color/tonemap/reinhard)

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

Dependencies:

Use:

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

Check it on Github



#ifndef FNC_TONEMAPREINHARD
#define FNC_TONEMAPREINHARD
vec3 tonemapReinhard(const vec3 v) { return v / (1.0 + luminance(v)); }
vec4 tonemapReinhard(const vec4 v) { return vec4( tonemapReinhard(v.rgb), v.a ); }
#endif

Dependencies:

Use:

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

Check it on Github



#ifndef FNC_TONEMAPREINHARD
#define FNC_TONEMAPREINHARD
float3 tonemapReinhard(const float3 x) { return x / (1.0 + luminance(x)); }
float4 tonemapReinhard(const float4 x) { return float4( tonemapReinhard(x.rgb), x.a ); }
#endif

License

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