Browse Source

Fix border artifacts at the edge of deep parallax.

Guilherme Felipe 7 năm trước cách đây
mục cha
commit
85f4d33276
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      scene/resources/material.cpp

+ 2 - 0
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";
 		}