diff --git a/gloom-rs/shaders/simple.vert b/gloom-rs/shaders/simple.vert index 5bf2e12..804d4eb 100644 --- a/gloom-rs/shaders/simple.vert +++ b/gloom-rs/shaders/simple.vert @@ -2,7 +2,15 @@ in vec3 position; +// this matrix mirrors over the x-axis and the y-axis simultaneously +uniform mat4 flip = mat4( + vec4(-1.0f, 0.0f, 0.0f, 0.0f), // column 0 + vec4( 0.0f, -1.0f, 0.0f, 0.0f), // column 1 + vec4( 0.0f, 0.0f, 1.0f, 0.0f), // column 2 + vec4( 0.0f, 0.0f, 0.0f, 1.0f) // column 3 +); + void main() { - gl_Position = vec4(position, 1.0f); -} \ No newline at end of file + gl_Position = flip * vec4(position, 1.0f); +}