LYGIA Shader Library

soft (lygia/v1.2.0/color/palette/spectral/soft)

Soft chroma spectrum

Dependencies:

Use:

<vec3> spectral_soft(<float> value)

Check it on Github


#ifndef FNC_CHROMA
#define FNC_CHROMA

vec3 spectral_soft(float x) {
    float delta = 0.5;
    vec3 color = vec3(1.0);
    float freq = x * PI;
    color.r = sin(freq - delta);
    color.g = sin(freq);
    color.b = sin(freq + delta);
    return pow(color, vec3(4.0));
}

#endif

Dependencies:

Use:

<float3> spectral_soft(<float> value)

Check it on Github



#ifndef FNC_SPECTRAL_SOFT
#define FNC_SPECTRAL_SOFT

float3 spectral_soft(float x) {
    float delta = 0.5;
    float3 color = float3(1.0, 1.0, 1.0);
    float freq = x * PI;
    color.r = sin(freq - delta);
    color.g = sin(freq);
    color.b = sin(freq + delta);
    return pow(color, float3(4.0, 4.0, 4.0));
}

#endif

Examples

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