summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile-shader.frag
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/tile-shader.frag')
-rw-r--r--shaders/tile-shader.frag5
1 files changed, 4 insertions, 1 deletions
diff --git a/shaders/tile-shader.frag b/shaders/tile-shader.frag
index 624fc8c5..2d3de0b2 100644
--- a/shaders/tile-shader.frag
+++ b/shaders/tile-shader.frag
@@ -1,11 +1,14 @@
uniform vec3 color = vec3(1.0, 1.0, 1.0);
-uniform sampler2D textureData;
+layout(location = 2) uniform sampler2D textureData;
+layout(location = 1) uniform float y_scale;
in vec2 interpolatedTextureCoordinates;
+in float interpolated_frag_depth;
out vec4 fragmentColor;
void main() {
fragmentColor.rgb = color*texture(textureData, interpolatedTextureCoordinates).rgb;
fragmentColor.a = 1.0;
+ gl_FragDepth = -interpolated_frag_depth * y_scale;
}