mirror of
https://github.com/ApfelTeeSaft/vb01.git
synced 2026-08-26 19:33:45 +00:00
33 lines
563 B
GLSL
33 lines
563 B
GLSL
#version 330 core
|
|
|
|
in vec2 texCoords;
|
|
|
|
out vec4 FragColor;
|
|
|
|
uniform sampler2D frag;
|
|
uniform sampler2D bright;
|
|
uniform bool hdr;
|
|
uniform bool bloom;
|
|
uniform float exposure;
|
|
uniform float gamma;
|
|
|
|
void main(){
|
|
vec4 hdrColor=texture(frag,texCoords);
|
|
vec4 brightColor=texture(bright,texCoords);
|
|
vec2 texel=1.0/textureSize(bright,0);
|
|
|
|
if(bloom)
|
|
hdrColor+=brightColor;
|
|
|
|
if(hdr){
|
|
//Reinhardt
|
|
//c.rgb=c.rgb/(c.rgb+vec3(1.));
|
|
|
|
//Exp
|
|
hdrColor.rgb=vec3(1.)-exp(-hdrColor.rgb*exposure);
|
|
}
|
|
|
|
hdrColor.rgb=pow(hdrColor.rgb,vec3(1/gamma));
|
|
FragColor=hdrColor;
|
|
}
|