36 lines
1.1 KiB
GLSL
36 lines
1.1 KiB
GLSL
#version 450
|
|
|
|
layout(location = 0) in vec2 inPosition;
|
|
layout(location = 1) in vec4 inColor;
|
|
layout(location = 2) in vec2 inTexCoord;
|
|
|
|
layout(location = 0) out vec4 fragColor;
|
|
layout(location = 1) out vec2 fragTexCoord;
|
|
|
|
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 padding1; // offset 20
|
|
float padding2; // offset 24
|
|
} ubo;
|
|
|
|
void main() {
|
|
// ULTIMATE TEST: Use hardcoded resolution value instead of UBO
|
|
// This will prove whether the problem is in UBO binding or somewhere else
|
|
|
|
// Hardcode the resolution we know is correct from debug output
|
|
float hardcodedWidth = 756.0;
|
|
float hardcodedHeight = 425.0;
|
|
|
|
// Now use UBO values - they should match the C++ struct exactly
|
|
float ndcX = (inPosition.x / ubo.resX) * 2.0 - 1.0;
|
|
float ndcY = (inPosition.y / ubo.resY) * 2.0 - 1.0;
|
|
|
|
gl_Position = vec4(ndcX, ndcY, 0.0, 1.0);
|
|
fragColor = inColor;
|
|
fragTexCoord = inTexCoord;
|
|
}
|