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;