paysages : Added quick antialiasing to material small previews.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@334 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-06-02 21:01:35 +00:00 committed by ThunderK
parent c0db22b200
commit f8fc22fbf7
2 changed files with 9 additions and 3 deletions

View file

@ -43,8 +43,9 @@ QColor SmallMaterialPreview::getColor(double x, double y)
{
double dist = sqrt(x * x + y * y);
Vector3 point;
Color color;
if (dist > 1.0)
if (dist >= 1.0)
{
return colorToQColor(COLOR_TRANSPARENT);
}
@ -62,8 +63,12 @@ QColor SmallMaterialPreview::getColor(double x, double y)
}
point = v3Normalize(point);
return colorToQColor(lightingApplyToSurface(&_lighting, &_renderer, point, point, *_material));
color = lightingApplyToSurface(&_lighting, &_renderer, point, point, *_material);
if (dist > 0.95)
{
color.a = (1.0 - dist) / 0.05;
}
return colorToQColor(color);
}
}

View file

@ -150,6 +150,7 @@ CloudsLayerDefinition cloudsLayerCreateDefinition()
result.material.base.r = 0.7;
result.material.base.g = 0.7;
result.material.base.b = 0.7;
result.material.base.a = 1.0;
result.material.reflection = 0.3;
result.material.shininess = 0.8;
result.hardness = 0.15;