diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-27 18:01:44 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-27 18:01:44 +0200 |
| commit | 97cfca98bde2a74257e2fa0d9112b77e4fa824f1 (patch) | |
| tree | 4afa25ab5778d3581d1dfdf84654d67a041a3480 /shaders | |
| parent | 108ae0682d5d45eafc8dabe58b4509a54c66d837 (diff) | |
aa
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/tile-shader.frag | 2 | ||||
| -rw-r--r-- | shaders/tile-shader.vert | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/shaders/tile-shader.frag b/shaders/tile-shader.frag index 790399e8..5d40df69 100644 --- a/shaders/tile-shader.frag +++ b/shaders/tile-shader.frag @@ -1,3 +1,5 @@ +precision highp float; + layout(location = 2) uniform sampler2D textureData; layout(location = 1) uniform float y_scale; diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert index 03c1f08a..6241977b 100644 --- a/shaders/tile-shader.vert +++ b/shaders/tile-shader.vert @@ -3,6 +3,7 @@ precision highp float; layout(location = 0) in vec4 position; layout(location = 1) in vec2 textureCoordinates; layout(location = 0) uniform vec2 scale; +layout(location = 3) uniform vec2 offset; out vec2 interpolatedTextureCoordinates; out float interpolated_frag_depth; @@ -11,7 +12,7 @@ void main() { interpolatedTextureCoordinates = textureCoordinates; float cx = 2/scale.x, cy = 2/scale.y; - float x = position.x, y = position.y, z = position.z; - gl_Position = vec4((x-y)*cx, (x+y+z*2)*cx*0.75, 0, 1); + float x = position.y, y = position.x, z = position.z; + gl_Position = vec4((x-y+offset.x)*cx, (x+y+z*2)*cx*0.75-offset.y*cx, 0, 1); interpolated_frag_depth = -position.z; } |
