|
|
@@ -202,8 +202,8 @@ void TerrainPatch::addLOD(float* heights, unsigned int width, unsigned int heigh
|
|
|
v += 3;
|
|
|
|
|
|
// Compute texture coord
|
|
|
- v[0] = (float)x / width;
|
|
|
- v[1] = 1.0f - (float)z / height;
|
|
|
+ v[0] = (float)x / (width-1);
|
|
|
+ v[1] = 1.0f - (float)z / (height-1);
|
|
|
if (xskirt)
|
|
|
{
|
|
|
float offset = verticalSkirtSize / width;
|
|
|
@@ -419,6 +419,9 @@ int TerrainPatch::addSampler(const char* path)
|
|
|
// Add a new sampler to the list
|
|
|
Texture::Sampler* sampler = Texture::Sampler::create(texture);
|
|
|
texture->release();
|
|
|
+
|
|
|
+ // This may need to be clamp in some cases to prevent edge bleeding? Possibly a
|
|
|
+ // configuration variable in the future.
|
|
|
sampler->setWrapMode(Texture::REPEAT, Texture::REPEAT);
|
|
|
sampler->setFilterMode(Texture::LINEAR_MIPMAP_LINEAR, Texture::LINEAR);
|
|
|
if (firstAvailableIndex != -1)
|