LYGIA Shader Library

unreal (lygia/v1.2.0/color/tonemap/unreal)

Adapted to be close to TonemapACES, with similar range. Gamma 2.2 correction is baked in, don't use with sRGB conversion! https://docs.unrealengine.com/4.26/en-US/RenderingAndGraphics/PostProcessEffects/ColorGrading/

Use:

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

Check it on Github


#ifndef FNC_TONEMAPUNREAL
#define FNC_TONEMAPUNREAL
vec3 tonemapUnreal(const vec3 x) { return x / (x + 0.155) * 1.019; }
vec4 tonemapUnreal(const vec4 x) { return vec4(tonemapUnreal(x.rgb), x.a); }
#endif

Use:

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

Check it on Github


#ifndef FNC_TONEMAPUNREAL
#define FNC_TONEMAPUNREAL
float3 tonemapUnreal(const float3 x) { return x / (x + 0.155) * 1.019; }
float4 tonemapUnreal(const float4 x) { return float4(tonemapUnreal(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