diff --git a/lib_paysages/terrain.c b/lib_paysages/terrain.c index a752146..0525354 100644 --- a/lib_paysages/terrain.c +++ b/lib_paysages/terrain.c @@ -260,12 +260,12 @@ static void _renderQuad(double x, double z, double size) double terrainGetHeight(double x, double z) { - return _getHeight(&_definition, x, z, 0.01 / (double)render_quality); + return _getHeight(&_definition, x, z, 0.0); } double terrainGetHeightNormalized(double x, double z) { - return 0.5 + _getHeight(&_definition, x, z, 0.01 / (double)render_quality) / (_max_height * 2.0); + return 0.5 + _getHeight(&_definition, x, z, 0.0) / (_max_height * 2.0); } Color terrainGetColorCustom(double x, double z, double detail, TerrainDefinition* definition, TerrainQuality* quality, TerrainEnvironment* environment) diff --git a/lib_paysages/textures.c b/lib_paysages/textures.c index 83c8543..9d4be49 100644 --- a/lib_paysages/textures.c +++ b/lib_paysages/textures.c @@ -123,6 +123,7 @@ static inline Vector3 _getNormal(TextureDefinition* definition, Vector3 point, d ref.x = 0.0; ref.y = 0.0; + point.y = terrainGetHeight(point.x, point.z) + noiseGet2DTotal(definition->bump_noise, point.x, point.z); dpoint.x = point.x - scale; dpoint.z = point.z;