diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-02-23 16:47:24 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-02-23 16:47:24 +0100 |
commit | 5664fd34a2f0317a276249762512d1a479fd7585 (patch) | |
tree | 38425c03b171145f4e7774a20f975dc7389f6c28 /shaders | |
parent | 767f69d60c87a039c6ab0c3bf9ba4ed171b28da4 (diff) |
flush
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/tile-shader.frag | 5 | ||||
-rw-r--r-- | shaders/tile-shader.vert | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/shaders/tile-shader.frag b/shaders/tile-shader.frag index 2d3de0b2..790399e8 100644 --- a/shaders/tile-shader.frag +++ b/shaders/tile-shader.frag @@ -1,4 +1,3 @@ -uniform vec3 color = vec3(1.0, 1.0, 1.0); layout(location = 2) uniform sampler2D textureData; layout(location = 1) uniform float y_scale; @@ -8,7 +7,7 @@ in float interpolated_frag_depth; out vec4 fragmentColor; void main() { - fragmentColor.rgb = color*texture(textureData, interpolatedTextureCoordinates).rgb; + fragmentColor.rgb = texture(textureData, interpolatedTextureCoordinates).rgb; fragmentColor.a = 1.0; - gl_FragDepth = -interpolated_frag_depth * y_scale; + gl_FragDepth = interpolated_frag_depth * y_scale; } diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert index cc90bae5..10b17f38 100644 --- a/shaders/tile-shader.vert +++ b/shaders/tile-shader.vert @@ -12,5 +12,5 @@ void main() { interpolatedTextureCoordinates = textureCoordinates; gl_Position = projection * vec4(position.xy, 0, position.w) + vec4(0, position.z * y_scale, 0, 0); - interpolated_frag_depth = position.z; + interpolated_frag_depth = -position.z; } |