]> git.mxchange.org Git - simgear.git/commitdiff
Reduce the height of tree UV coordinates to work around mipmap issues.
authorStuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Wed, 1 May 2013 21:01:45 +0000 (22:01 +0100)
committerStuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Wed, 1 May 2013 21:01:45 +0000 (22:01 +0100)
simgear/scene/tgdb/TreeBin.cxx

index 3f67483ac6847576c5cfa177bc3caab2a062e912..a101bf0e5c86b0b5809aa209cc12589c0d6cc06e 100644 (file)
@@ -135,11 +135,13 @@ Geometry* makeSharedTreeGeometry(int numQuads)
         // space, as the texture has a number of different trees on
         // it. Here we assign random coordinates and let the shader
         // choose the variety.
+        // Height isn't quite 0.25 to allow for UV map bleeding when
+        // mipmaps are generated.
         float variety = mt_rand(&seed);
         t->push_back(Vec2(variety, 0.0f));
         t->push_back(Vec2(variety + 1.0f, 0.0f));
-        t->push_back(Vec2(variety + 1.0f, 0.25f));
-        t->push_back(Vec2(variety, 0.25f));
+        t->push_back(Vec2(variety + 1.0f, 0.246f));
+        t->push_back(Vec2(variety, 0.246f));
     }
     Geometry* result = new Geometry;
     result->setVertexArray(v);