Fixed the terrain walker hitting displacement immediately at high quality

This commit is contained in:
Michaël Lemaire 2013-12-31 16:55:10 +01:00 committed by Michael Lemaire
parent 5e769d8ed0
commit 5579045604
2 changed files with 3 additions and 3 deletions

1
TODO
View file

@ -2,7 +2,6 @@ Technology Preview 2 :
- Add initial terrain offset so that the (0,0) coordinates are above water (to avoid starting at the middle of a sea).
- Use water height as 0.0 (offset the terrain).
- Add missing cloud models.
- Fix the terrain walker hitting displacement immediately at high quality.
- Finish material dialog.
- Finish texture dialog.
- Fix rendering when inside a cloud layer, with other upper or lower layers.

View file

@ -107,7 +107,7 @@ static Vector3 _getDetailNormal(SoftwareRenderer* renderer, Vector3 base_locatio
pivot = VECTOR_UP;
}
dx = base_normal.crossProduct(pivot).normalize();
dy = base_normal.crossProduct(dx);
dy = base_normal.crossProduct(dx).normalize();
/* Apply detail noise locally */
Vector3 center, north, east, south, west;
@ -191,7 +191,8 @@ TexturesRenderer::TexturesResult TexturesRenderer::applyToTerrain(double x, doub
if (info->presence > 0.0)
{
Vector3 normal = _getDetailNormal(parent, terrain.location, terrain.normal, info->layer);
info->color = parent->applyLightingToSurface(terrain.location, normal, *info->layer->material);
Vector3 location(x, terrain.location.y, z);
info->color = parent->applyLightingToSurface(location, normal, *info->layer->material);
}
else
{