opengl: Fixed color range of terrain textures

This will lose precision, but is sufficient right now, and
avoids bright textures (like snow) to be greyed.
This commit is contained in:
Michaël Lemaire 2016-01-06 01:45:27 +01:00
parent 252d7e7b87
commit f9d0918bcb
2 changed files with 2 additions and 3 deletions

View file

@ -98,8 +98,7 @@ bool OpenGLTerrainChunk::maintain() {
double x = _startx + factor * to_double(i);
double z = _startz + factor * to_double(j);
Color color = _renderer->getTexturesRenderer()->applyToTerrain(x, z).final_color;
color.normalize();
new_image->setPixel(i, j, color.to32BitRGBA());
new_image->setPixel(i, j, Color(color.r * 0.2, color.g * 0.2, color.b * 0.2).normalized().to32BitRGBA());
}
}

View file

@ -4,7 +4,7 @@ out vec4 final_color;
void main(void)
{
final_color = texture(groundTexture, texcoord);
final_color = vec4(texture(groundTexture, texcoord).rgb * 5.0, 1.0);
final_color = applyAerialPerspective(final_color);