mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
20 lines
370 B
GLSL
Executable File
20 lines
370 B
GLSL
Executable File
#version 330 core
|
|
|
|
in vec2 texCoords;
|
|
|
|
out vec4 FragColor;
|
|
|
|
uniform bool texturingEnabled;
|
|
uniform bool diffuseColorEnabled;
|
|
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);
|
|
}
|
|
FragColor=c;
|
|
}
|