mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-27 03:53:24 +00:00
32 lines
571 B
GLSL
Executable File
32 lines
571 B
GLSL
Executable File
#version 330 core
|
|
|
|
in vec2 texCoords;
|
|
|
|
out vec4 FragColor;
|
|
|
|
uniform bool texturingEnabled;
|
|
uniform bool diffuseColorEnabled;
|
|
uniform bool guiPlane;
|
|
uniform vec4 diffuseColor;
|
|
uniform sampler2D tex;
|
|
|
|
void main(){
|
|
vec4 c=texturingEnabled?texture(tex,texCoords):diffuseColor;
|
|
if(diffuseColorEnabled){
|
|
float alpha=texture(tex,texCoords).w;
|
|
c=vec4(diffuseColor.xyz,alpha);
|
|
}
|
|
if(guiPlane){
|
|
float gamma=1,exposure=1;
|
|
|
|
//Reinhardt
|
|
//c.rgb=c.rgb/(c.rgb+vec3(1.));
|
|
|
|
//Exp
|
|
c.rgb=vec3(1.)-exp(-c.rgb*exposure);
|
|
|
|
c.rgb=pow(c.rgb,vec3(1/gamma));
|
|
}
|
|
FragColor=c;
|
|
}
|