Reduce the height of tree UV coordinates to work around mipmap issues.
This commit is contained in:
@@ -135,11 +135,13 @@ Geometry* makeSharedTreeGeometry(int numQuads)
|
|||||||
// space, as the texture has a number of different trees on
|
// space, as the texture has a number of different trees on
|
||||||
// it. Here we assign random coordinates and let the shader
|
// it. Here we assign random coordinates and let the shader
|
||||||
// choose the variety.
|
// choose the variety.
|
||||||
|
// Height isn't quite 0.25 to allow for UV map bleeding when
|
||||||
|
// mipmaps are generated.
|
||||||
float variety = mt_rand(&seed);
|
float variety = mt_rand(&seed);
|
||||||
t->push_back(Vec2(variety, 0.0f));
|
t->push_back(Vec2(variety, 0.0f));
|
||||||
t->push_back(Vec2(variety + 1.0f, 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 + 1.0f, 0.246f));
|
||||||
t->push_back(Vec2(variety, 0.25f));
|
t->push_back(Vec2(variety, 0.246f));
|
||||||
}
|
}
|
||||||
Geometry* result = new Geometry;
|
Geometry* result = new Geometry;
|
||||||
result->setVertexArray(v);
|
result->setVertexArray(v);
|
||||||
|
|||||||
Reference in New Issue
Block a user