diff options
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/tile.cpp | 9 | ||||
| -rw-r--r-- | shaders/tile.hpp | 6 |
2 files changed, 9 insertions, 6 deletions
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 diff --git a/shaders/tile.hpp b/shaders/tile.hpp index 19d2d552..280850b9 100644 --- a/shaders/tile.hpp +++ b/shaders/tile.hpp @@ -37,9 +37,9 @@ struct tile_shader : GL::AbstractShaderProgram template<typename T, typename... Xs> decltype(auto) draw(T&& mesh, Xs&&... xs); - static constexpr Vector2s max_screen_tiles{8, 8}; - static constexpr float depth_tile_size = 1/(double)(TILE_MAX_DIM * 2 * max_screen_tiles.product()); - static const float scenery_depth_offset, wall_depth_offset, z_depth_offset; + static const Vector2s max_screen_tiles; + static const float depth_tile_size; + static const float character_depth_offset, scenery_depth_offset, wall_depth_offset, z_depth_offset; private: void _draw(); |
