Dicewars-Siedler/assets/shaders/guiFragmentShader.glsl
Sebastian Böckelmann def763d6ae
All checks were successful
Tests / test (push) Successful in 2m36s
ADD: Dimming textures + pushing newGameLayer
2026-04-25 11:18:45 +02:00

33 lines
766 B
GLSL

#version 400 core
in vec2 textureCoords;
out vec4 color;
uniform sampler2D guiTexture;
uniform sampler2D backgroundTexture;
uniform float brightness; // 1.0 = normal
uniform vec3 tintColor; // (0,0,0) = kein Tint
uniform float tintStrength; // 0.0 = aus
uniform bool hasForeground;
uniform bool hasBackground;
uniform float dimFactor;
void main(void) {
vec4 fg = hasForeground ? texture(guiTexture, textureCoords) : vec4(0.0);
vec4 bg = hasBackground ? texture(backgroundTexture, textureCoords) : vec4(0.0);
vec4 textureColor = mix(bg, fg, fg.a);
textureColor.rgb *= brightness;
//Tint (Overlay)
textureColor.rgb = mix(textureColor.rgb, tintColor, tintStrength);
color = textureColor;
color *= dimFactor;
}