Skip to content

Commit

Permalink
Clamp texture sampling of grass to avoid filtering artifacts with MSAA
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Apr 21, 2024
1 parent 74437e6 commit beb990e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ For a more detailed list of past and incoming changes, see the commit history.
- Added support for importing and exporting 32-bit raw files
- Allow to set brush size and opacity size with spinboxes (thanks to Vercix)
- Exposed specular parameter in ground shaders
- Save terrain data immediately when assigning a new `data_directory` (attempt to workaround random saving issue #232)
- Fixed brush cursor looked off-center at close range when using tiny brush sizes
- Fixed error when trying to change `TextureSet` mode while it has textures in it
- Fixed shader parameters not displaying the right value in the inspector until they are set by the user at least once
Expand All @@ -23,6 +24,7 @@ For a more detailed list of past and incoming changes, see the commit history.
- Fixed detail layers were rendering repeating instances outside the terrain when `map_scale` is not 1.0
- Fixed detail layers were not rendering correctly when terrain is in centered mode
- Fixed texture import dialog was opening a very tall window (issue #423)
- Fixed detail layers "lines" showing on top of grass quads when MSAA is enabled


1.7.2
Expand Down
5 changes: 4 additions & 1 deletion addons/zylann.hterrain/shaders/detail.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ uniform sampler2D u_terrain_globalmap : source_color;
uniform mat4 u_terrain_inverse_transform;
uniform mat3 u_terrain_normal_basis;

uniform sampler2D u_albedo_alpha : source_color;
// We need to disable repetition, otherwise it can cause "lines" to appear on top of grass quads
// due to filtering, especially when MSAA is enabled
uniform sampler2D u_albedo_alpha : source_color, repeat_disable;

uniform float u_view_distance = 100.0;
uniform float u_globalmap_tint_bottom : hint_range(0.0, 1.0);
uniform float u_globalmap_tint_top : hint_range(0.0, 1.0);
Expand Down

0 comments on commit beb990e

Please sign in to comment.