Bläddra i källkod

Batching - blank UVs in polys that contain no UVs

Polys that have no texture assigned contain no UVs in the poly command. These were previously not blanked, leading to random values if read from a custom shader.

This PR just blanks them.
lawnjelly 4 år sedan
förälder
incheckning
4cadae5713
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      drivers/gles_common/rasterizer_canvas_batcher.h

+ 4 - 0
drivers/gles_common/rasterizer_canvas_batcher.h

@@ -1621,6 +1621,8 @@ bool C_PREAMBLE::_prefill_polygon(RasterizerCanvas::Item::CommandPolygon *p_poly
 			if (ind < p_poly->uvs.size()) {
 			if (ind < p_poly->uvs.size()) {
 				const Point2 &uv = p_poly->uvs[ind];
 				const Point2 &uv = p_poly->uvs[ind];
 				bvs[n].uv.set(uv.x, uv.y);
 				bvs[n].uv.set(uv.x, uv.y);
+			} else {
+				bvs[n].uv.set(0.0f, 0.0f);
 			}
 			}
 
 
 			vertex_colors[n] = precalced_colors[ind];
 			vertex_colors[n] = precalced_colors[ind];
@@ -1756,6 +1758,8 @@ PREAMBLE(bool)::_software_skin_poly(RasterizerCanvas::Item::CommandPolygon *p_po
 		if (ind < p_poly->uvs.size()) {
 		if (ind < p_poly->uvs.size()) {
 			const Point2 &uv = p_poly->uvs[ind];
 			const Point2 &uv = p_poly->uvs[ind];
 			bvs[n].uv.set(uv.x, uv.y);
 			bvs[n].uv.set(uv.x, uv.y);
+		} else {
+			bvs[n].uv.set(0.0f, 0.0f);
 		}
 		}
 
 
 		vertex_colors[n] = p_precalced_colors[ind];
 		vertex_colors[n] = p_precalced_colors[ind];