From 85f4d3327601d9c75b1d94d9e63d7c5af42ceaba Mon Sep 17 00:00:00 2001 From: Guilherme Felipe Date: Thu, 9 Aug 2018 19:30:17 -0300 Subject: [PATCH] Fix border artifacts at the edge of deep parallax. --- scene/resources/material.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 875b72159a4..dc29102492d 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -694,6 +694,8 @@ void SpatialMaterial::_update_shader() { } code += "\t\tbase_uv=ofs;\n"; + code += "\t\tif(base_uv.x > 1.0 || base_uv.y > 1.0 || base_uv.x < 0.0 || base_uv.y < 0.0)\n"; + code += "\t\t\tdiscard;\n"; if (features[FEATURE_DETAIL] && detail_uv == DETAIL_UV_2) { code += "\t\tbase_uv2-=ofs;\n"; }