mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
8dce81d8fd
OpenGL use the [-1; 1] range for clip depths, Direct3D [0; 1]. Use toClipSpace to encapsulate the difference. Signed-off-by: Elias Naur <mail@eliasnaur.com>
26 lines
446 B
GLSL
26 lines
446 B
GLSL
#version 310 es
|
|
|
|
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
precision highp float;
|
|
|
|
#include <common.inc>
|
|
|
|
layout(binding = 0) uniform Block {
|
|
vec4 transform;
|
|
vec4 uvTransform;
|
|
float z;
|
|
};
|
|
|
|
layout(location = 0) in vec2 pos;
|
|
|
|
layout(location = 1) in vec2 uv;
|
|
|
|
layout(location = 0) out vec2 vUV;
|
|
|
|
void main() {
|
|
vec2 p = pos*transform.xy + transform.zw;
|
|
gl_Position = toClipSpace(vec4(p, z, 1));
|
|
vUV = uv*uvTransform.xy + uvTransform.zw;
|
|
}
|