Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scene/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,9 @@ void BaseMaterial3D::_update_shader() {
// used. The losers will free their shader.

String texfilter_str;
// Force linear filtering for the heightmap texture, as the heightmap effect
// Force linear filtering with no mipmaps for the heightmap texture, as the heightmap effect
// looks broken with nearest-neighbor filtering (with and without Deep Parallax).
// Mipmaps also result in stray pixel artifacts when Deep Parallax is enabled.
String texfilter_height_str;
switch (texture_filter) {
case TEXTURE_FILTER_NEAREST:
Expand All @@ -739,19 +740,19 @@ void BaseMaterial3D::_update_shader() {
break;
case TEXTURE_FILTER_NEAREST_WITH_MIPMAPS:
texfilter_str = "filter_nearest_mipmap";
texfilter_height_str = "filter_linear_mipmap";
texfilter_height_str = "filter_linear";
break;
case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS:
texfilter_str = "filter_linear_mipmap";
texfilter_height_str = "filter_linear_mipmap";
texfilter_height_str = "filter_linear";
break;
case TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC:
texfilter_str = "filter_nearest_mipmap_anisotropic";
texfilter_height_str = "filter_linear_mipmap_anisotropic";
texfilter_height_str = "filter_linear";
break;
case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC:
texfilter_str = "filter_linear_mipmap_anisotropic";
texfilter_height_str = "filter_linear_mipmap_anisotropic";
texfilter_height_str = "filter_linear";
break;
case TEXTURE_FILTER_MAX:
break; // Internal value, skip.
Expand Down
Loading