All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.shaders.includes.gamma.h Maven / Gradle / Ivy

The newest version!
#ifndef gamma_h
#define gamma_h
#pragma include includes/misc.h
#ifndef GAMMA_VAL
    #define GAMMA_VAL 2.2
#endif

uconst float gamma = GAMMA_VAL;

#ifdef COMPILED
    const float invgamma = 1. / gamma;
#else
    #define invgamma (1./gamma)
#endif

#ifdef GAMMA
    #define toLinear(x) pow(x, gamma)
    #define toGamma(x) pow(x, invgamma)
#else
    #define toLinear(x) x
    #define toGamma(x) x
#endif
#endif




© 2015 - 2024 Weber Informatics LLC | Privacy Policy