summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-12 00:08:56 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-12 00:08:56 +0200
commit903e1644fce5652a621803a6eb3617d605d22434 (patch)
treece088b04f92ffc8bdb5e6c1d31e3981e20a5b2bb /shaders/tile.hpp
parent993d828c3c2cdab6174e460c39a605dbd31d192c (diff)
wip
Diffstat (limited to 'shaders/tile.hpp')
-rw-r--r--shaders/tile.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/shaders/tile.hpp b/shaders/tile.hpp
index 4bf78d09..fd3788f3 100644
--- a/shaders/tile.hpp
+++ b/shaders/tile.hpp
@@ -37,8 +37,9 @@ struct tile_shader : GL::AbstractShaderProgram
template<typename T, typename... Xs>
decltype(auto) draw(T&& mesh, Xs&&... xs);
- static constexpr float depth_tile_size = 1.f/(256 * TILE_COUNT);
- static constexpr float wall_depth_offset = .125f, scenery_depth_offset = .25f, character_depth_offset = .5f;
+ static constexpr float depth_tile_size = 3.56e-15; // 1 - nextafter(1, 0) * TILE_MAX_DIM / 2
+ static constexpr float depth_start = -1 + depth_tile_size;
+ static constexpr float scenery_depth_offset = .5f, character_depth_offset = .5f;
private:
void _draw();