From dc88cc5f478457e5f0b708d5fdf8b5bb37e71553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Tue, 31 Jan 2012 09:48:38 +0000 Subject: [PATCH] paysages : Small fixes. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@255 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- TODO | 5 ++--- lib_paysages/system.c | 3 +++ lib_paysages/terrain.c | 11 +++++++++++ lib_paysages/water.c | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 4055377..ff2a26b 100644 --- a/TODO +++ b/TODO @@ -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. - All noises should use the same entropy pool (saved separately), and avoid reallocs. - Implement light multi-sampling (mainly for skydome). - Implement scaling and scrolling on previews. - Water and terrain LOD moves with the camera, fix it like in the wanderer. -- Find the random segfault at start (in PreviewTerrainColor::getColor). \ No newline at end of file +- Find the random segfault at start (in PreviewTerrainColor::getColor). +- Restore render progress. diff --git a/lib_paysages/system.c b/lib_paysages/system.c index 38b4de3..c2d64ec 100644 --- a/lib_paysages/system.c +++ b/lib_paysages/system.c @@ -31,6 +31,9 @@ static int _getCoreCount() #endif #ifdef _SC_NPROCESSORS_ONLN core_count = (int)sysconf(_SC_NPROCESSORS_ONLN); +#endif +#ifdef DEBUG_ONETHREAD + core_count = 1; #endif return core_count; } diff --git a/lib_paysages/terrain.c b/lib_paysages/terrain.c index c54aac8..9290ae7 100644 --- a/lib_paysages/terrain.c +++ b/lib_paysages/terrain.c @@ -174,6 +174,16 @@ Color terrainLightFilter(TerrainDefinition* definition, Renderer* renderer, Colo { 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_base = 1.0; @@ -228,6 +238,7 @@ static Color _getColor(TerrainDefinition* definition, Renderer* renderer, Vector color = renderer->applyTextures(renderer, point, precision); color = renderer->applyAtmosphere(renderer, point, color); + color = renderer->applyClouds(renderer, color, renderer->camera_location, point); return color; } diff --git a/lib_paysages/water.c b/lib_paysages/water.c index 6fb5005..6b77600 100644 --- a/lib_paysages/water.c +++ b/lib_paysages/water.c @@ -219,6 +219,7 @@ WaterResult waterGetColorDetail(WaterDefinition* definition, Renderer* renderer, material.base = color; color = renderer->applyLightingToSurface(renderer, location, normal, material); color = renderer->applyAtmosphere(renderer, location, color); + color = renderer->applyClouds(renderer, color, renderer->camera_location, location); result.base = definition->material.base; result.final = color;