summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-14 11:58:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-14 11:58:23 +0200
commitf5c387da470ae43a2c8aff75b419e784c8bb3bc5 (patch)
tree744a80e82462849ae538b6c04e941ab6fd7d09fa /shaders
parente1ae8881918415ef13fdea7c7087d01d873ad07a (diff)
it probably renders correctly now
Diffstat (limited to 'shaders')
-rw-r--r--shaders/tile.cpp4
-rw-r--r--shaders/tile.hpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/shaders/tile.cpp b/shaders/tile.cpp
index 9725c974..9c347021 100644
--- a/shaders/tile.cpp
+++ b/shaders/tile.cpp
@@ -78,4 +78,8 @@ 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;
+
} // namespace floormat
diff --git a/shaders/tile.hpp b/shaders/tile.hpp
index 47ec2f35..19d2d552 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{32, 32};
+ 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 constexpr float scenery_depth_offset = 0.25f, character_depth_offset = 0.25f, wall_depth_offset = 0;
+ static const float scenery_depth_offset, wall_depth_offset, z_depth_offset;
private:
void _draw();