From 3e96b624a2d26bb66a1aad789b0bb3e131c3c3cd Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 22 Sep 2013 10:21:15 +0200 Subject: [PATCH] Bezier/Spline: Don't generate UVs if UVs are already specified in the control points --- GPU/GLES/Spline.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/GPU/GLES/Spline.cpp b/GPU/GLES/Spline.cpp index 585984a3dc..cf7585707e 100644 --- a/GPU/GLES/Spline.cpp +++ b/GPU/GLES/Spline.cpp @@ -246,16 +246,18 @@ void TesselatePatch(u8 *&dest, int &count, const HWSplinePatch &patch, u32 vertT SimpleVertex v3 = *patch.points[point_index+5]; // Generate UV. TODO: Do this even if UV specified in control points? - float u = u_base + tile_u * third; - float v = v_base + tile_v * third; - v0.uv[0] = u; - v0.uv[1] = v; - v1.uv[0] = u + third; - v1.uv[1] = v; - v2.uv[0] = u; - v2.uv[1] = v + third; - v3.uv[0] = u + third; - v3.uv[1] = v + third; + if ((vertType & GE_VTYPE_TC_MASK) == 0) { + float u = u_base + tile_u * third; + float v = v_base + tile_v * third; + v0.uv[0] = u; + v0.uv[1] = v; + v1.uv[0] = u + third; + v1.uv[1] = v; + v2.uv[0] = u; + v2.uv[1] = v + third; + v3.uv[0] = u + third; + v3.uv[1] = v + third; + } // Generate normal if lighting is enabled (otherwise there's no point). // This is a really poor quality algorithm, we get facet normals.