#version 450 layout(location = 0) in vec4 fragColor; layout(location = 1) in vec2 fragTexCoord; layout(location = 2) in vec2 fragPosition; layout(location = 0) out vec4 outColor; layout(binding = 0, std140) uniform UniformBufferObject { float time; // offset 0 float resX; // offset 4 float resY; // offset 8 float rotation; // offset 12 float wavePhase; // offset 16 float paintingEnabled; // offset 20 (0.0 = locked, 1.0 = normal) float padding1; // offset 24 } ubo; void main() { // Check if painting is disabled (locked state) if (ubo.paintingEnabled < 0.5) { // Locked state: dark gray background (matching CustomWidget) outColor = vec4(0.157, 0.157, 0.157, 1.0); // RGB(40, 40, 40) return; } // Normal state: animated gradient background // Normalize position to 0-1 range vec2 uv = (fragPosition + 1.0) * 0.5; // Create dynamic gradient based on time float t = ubo.time / 360.0; // Calculate color components matching Qt CustomWidget float r = 0.392 + 0.196 * sin(t * 6.28318); float g = 0.588 + 0.196 * sin(t * 6.28318 + 1.047); float b = 0.784 + 0.216 * sin(t * 6.28318 + 2.094); vec3 color1 = vec3(r, g, b); vec3 color2 = vec3(0.118, 0.118, 0.235); // Linear gradient from top-left to bottom-right float gradient = uv.x * 0.5 + uv.y * 0.5; // Mix colors vec3 finalColor = mix(color1, color2, gradient); outColor = vec4(finalColor, 1.0); }