mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu/shaders: introduce toClipSpace to map to GPU native clip space
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>
This commit is contained in:
@@ -21,7 +21,7 @@ layout(location = 1) in vec2 uv;
|
||||
layout(location = 1) out vec2 vUV;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(pos*transform.xy + transform.zw, z, 1);
|
||||
gl_Position = toClipSpace(vec4(pos*transform.xy + transform.zw, z, 1));
|
||||
vUV = uv*uvTransform.xy + uvTransform.zw;
|
||||
vec3[2] fboTrans = fboTextureTransform();
|
||||
vec3 uv3 = transform3x2(fboTrans, vec3(uv, 1.0));
|
||||
|
||||
Reference in New Issue
Block a user