From 903e1644fce5652a621803a6eb3617d605d22434 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 12 Apr 2023 00:08:56 +0200 Subject: wip --- shaders/tile.cpp | 2 +- shaders/tile.hpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'shaders') diff --git a/shaders/tile.cpp b/shaders/tile.cpp index 8d859ff3..d5f6b7d3 100644 --- a/shaders/tile.cpp +++ b/shaders/tile.cpp @@ -74,7 +74,7 @@ void tile_shader::_draw() float tile_shader::depth_value(const local_coords& xy, float offset) noexcept { - return (xy.to_index() + offset)*depth_tile_size; + return depth_tile_size + (xy.to_index() + offset)*depth_tile_size; } } // namespace floormat 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 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(); -- cgit v1.2.3