diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-09 16:17:23 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-09 16:17:23 +0100 |
commit | 1febb02d958fa4cf8c15e3ca18f9d644f9fc80fb (patch) | |
tree | d9b389f6c2ff8e031bd70d503c289bcfddf2f048 /shaders/tile.vert | |
parent | 09605450ecc99ad1f4d50e9c143fda6c7762e702 (diff) |
depth buffer works!
Diffstat (limited to 'shaders/tile.vert')
-rw-r--r-- | shaders/tile.vert | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/tile.vert b/shaders/tile.vert index b512b7ac..ad038e6d 100644 --- a/shaders/tile.vert +++ b/shaders/tile.vert @@ -5,10 +5,11 @@ layout (location = 1) uniform vec2 offset; layout (location = 0) in vec4 position; layout (location = 1) in vec2 texcoords; +layout (location = 2) in float depth; noperspective out vec2 frag_texcoords; void main() { float x = -position.y, y = -position.x, z = position.z; - gl_Position = vec4((x-y+offset.x)*scale.x, ((x+y+z*2)*.59-offset.y)*scale.y, 0, 1); + gl_Position = vec4((x-y+offset.x)*scale.x, ((x+y+z*2)*.59-offset.y)*scale.y, depth, 1); frag_texcoords = texcoords; } |