LYGIA Shader Library

exposure (lygia/color/exposure)

change the exposure of a color

Use:

exposure(<float|vec3|vec4> color, float amount)

Check it on Github


#ifndef FNC_EXPOSURE
#define FNC_EXPOSURE
float exposure(float v, float a) { return v * pow(2., a); }
vec3 exposure(vec3 v, float a) { return v * pow(2., a); }
vec4 exposure(vec4 v, float a) { return vec4(v.rgb * pow(2., a), v.a); }
#endif

Use:

exposure(<float|float3|float4> color, float amount)

Check it on Github


#ifndef FNC_EXPOSURE
#define FNC_EXPOSURE
float exposure(float value, float amount) {
    return value * pow(2., amount);
}

float3 exposure(float3 color, float amount) {
    return color * pow(2., amount);
}

float4 exposure(float4 color, float amount) {
    return float4(exposure( color.rgb, amount ), color.a);
}
#endif

Check it on Github

fn exposure(color : vec3f, amount : f32) -> vec3f {
    return color * pow(2., amount);
}

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