From 879c76e8fc1c6aa4e23fe0b5ed7ac62e6b1caeb4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 14 Apr 2023 12:53:00 +0200 Subject: renders almost correctly Can't be done any better without using topo sort (which means full vbo uploads each frame). --- shaders/tile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'shaders/tile.cpp') diff --git a/shaders/tile.cpp b/shaders/tile.cpp index 9c347021..c8defb43 100644 --- a/shaders/tile.cpp +++ b/shaders/tile.cpp @@ -78,8 +78,11 @@ float tile_shader::depth_value(const local_coords& xy, float offset) noexcept return ((float)xy.x + (float)xy.y + offset) * depth_tile_size; } -const float tile_shader::scenery_depth_offset = 1./64; -const float tile_shader::wall_depth_offset = 0; -const float tile_shader::z_depth_offset = 1e-4f; +const Vector2s tile_shader::max_screen_tiles = {8, 8}; +const float tile_shader::character_depth_offset = 1 + 4./64; +const float tile_shader::scenery_depth_offset = 1 + 4./64; +const float tile_shader::wall_depth_offset = 1; +const float tile_shader::z_depth_offset = 1./64; +const float tile_shader::depth_tile_size = 1/(double)(TILE_MAX_DIM * 2 * max_screen_tiles.product()); } // namespace floormat -- cgit v1.2.3