diff options
Diffstat (limited to 'intern/sky')
-rw-r--r-- | intern/sky/source/sky_nishita.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/sky/source/sky_nishita.cpp b/intern/sky/source/sky_nishita.cpp index 27286ddecac..a31d4b39f83 100644 --- a/intern/sky/source/sky_nishita.cpp +++ b/intern/sky/source/sky_nishita.cpp @@ -287,11 +287,13 @@ void SKY_nishita_skymodel_precompute_texture(float *pixels, float latitude_step = M_PI_2_F / height; float longitude_step = M_2PI_F / width; + float half_lat_step = latitude_step / 2.0f; for (int y = start_y; y < end_y; y++) { - float latitude = latitude_step * y; + /* sample more pixels toward the horizon */ + float latitude = (M_PI_2_F + half_lat_step) * sqr((float)y / height); - float *pixel_row = pixels + (y * width) * stride; + float *pixel_row = pixels + (y * width * stride); for (int x = 0; x < half_width; x++) { float longitude = longitude_step * x - M_PI_F; |