paysages : Small fixes.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@255 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-01-31 09:48:38 +00:00 committed by ThunderK
parent e940bb0165
commit dc88cc5f47
4 changed files with 17 additions and 3 deletions

5
TODO
View file

@ -1,8 +1,7 @@
- Restore render progress
- Clouds are lighted without filtering from ground (clouds lighted at night !)
- Camera should respect ratio aspect of render area. - Camera should respect ratio aspect of render area.
- All noises should use the same entropy pool (saved separately), and avoid reallocs. - All noises should use the same entropy pool (saved separately), and avoid reallocs.
- Implement light multi-sampling (mainly for skydome). - Implement light multi-sampling (mainly for skydome).
- Implement scaling and scrolling on previews. - Implement scaling and scrolling on previews.
- Water and terrain LOD moves with the camera, fix it like in the wanderer. - Water and terrain LOD moves with the camera, fix it like in the wanderer.
- Find the random segfault at start (in PreviewTerrainColor::getColor). - Find the random segfault at start (in PreviewTerrainColor::getColor).
- Restore render progress.

View file

@ -31,6 +31,9 @@ static int _getCoreCount()
#endif #endif
#ifdef _SC_NPROCESSORS_ONLN #ifdef _SC_NPROCESSORS_ONLN
core_count = (int)sysconf(_SC_NPROCESSORS_ONLN); core_count = (int)sysconf(_SC_NPROCESSORS_ONLN);
#endif
#ifdef DEBUG_ONETHREAD
core_count = 1;
#endif #endif
return core_count; return core_count;
} }

View file

@ -174,6 +174,16 @@ Color terrainLightFilter(TerrainDefinition* definition, Renderer* renderer, Colo
{ {
return light; return light;
} }
else if (direction_to_light.y < 0.05)
{
return COLOR_BLACK;
}
else if (direction_to_light.y < 0.0000)
{
light.r *= (0.05 + direction_to_light.y) / 0.05;
light.g *= (0.05 + direction_to_light.y) / 0.05;
light.b *= (0.05 + direction_to_light.y) / 0.05;
}
inc_factor = (double)renderer->render_quality; inc_factor = (double)renderer->render_quality;
inc_base = 1.0; inc_base = 1.0;
@ -228,6 +238,7 @@ static Color _getColor(TerrainDefinition* definition, Renderer* renderer, Vector
color = renderer->applyTextures(renderer, point, precision); color = renderer->applyTextures(renderer, point, precision);
color = renderer->applyAtmosphere(renderer, point, color); color = renderer->applyAtmosphere(renderer, point, color);
color = renderer->applyClouds(renderer, color, renderer->camera_location, point);
return color; return color;
} }

View file

@ -219,6 +219,7 @@ WaterResult waterGetColorDetail(WaterDefinition* definition, Renderer* renderer,
material.base = color; material.base = color;
color = renderer->applyLightingToSurface(renderer, location, normal, material); color = renderer->applyLightingToSurface(renderer, location, normal, material);
color = renderer->applyAtmosphere(renderer, location, color); color = renderer->applyAtmosphere(renderer, location, color);
color = renderer->applyClouds(renderer, color, renderer->camera_location, location);
result.base = definition->material.base; result.base = definition->material.base;
result.final = color; result.final = color;