1 Oct 2021
~ Made Shaders now able to use Defines. ~ Moved complete Bloom-shader code in a single file (not working at the moment)
This commit is contained in:
parent
443877019b
commit
8a84182563
15 changed files with 325 additions and 44 deletions
|
|
@ -1,5 +1,4 @@
|
|||
#version 330
|
||||
#define TYPE //!TYPE
|
||||
|
||||
in vec2 vTexture;
|
||||
|
||||
|
|
@ -9,31 +8,19 @@ uniform float Gamma;
|
|||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
vec3 ACES(vec3 x) {
|
||||
const float a = 2.51;
|
||||
const float b = 0.03;
|
||||
const float c = 2.43;
|
||||
const float d = 0.59;
|
||||
const float e = 0.14;
|
||||
vec3 ACES(vec3);
|
||||
|
||||
return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0,1.0);
|
||||
}
|
||||
vec3 reinhardTone(vec3);
|
||||
|
||||
vec3 reinhardTone(vec3 col) {
|
||||
return col / (col + vec3(1.0));
|
||||
}
|
||||
|
||||
vec3 exposure(vec3 scene) {
|
||||
return vec3(1) - exp(-texture(Scene, vTexture).rgb * Exposure);
|
||||
}
|
||||
vec3 exposure(vec3);
|
||||
|
||||
void main() {
|
||||
|
||||
vec3 scene = texture2D(Scene, vTexture).rgb;
|
||||
vec3 result = exposure(scene);
|
||||
#if (TYPE == 1)
|
||||
#if defined(TYPE_REINHARD)
|
||||
result = reinhardTone(result);
|
||||
#elif (TYPE == 2)
|
||||
#elif defined(TYPE_ACES)
|
||||
result = ACES(result);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue