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

Use:

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

Check it on Github


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

Check it on Github


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

Licenses

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