diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2020-07-13 02:51:13 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2020-07-13 04:08:11 +0300 |
commit | 192bd2605f2580ee221d2e304fe2dfea573753d5 (patch) | |
tree | 42428c34790faed226ad9c12e9f0b529464807a2 /intern/sky/source | |
parent | 41e6f9bd437cb5f23dd6a8ad41c6142b0520f65d (diff) |
Cycles: Change precomputed Sky Texture mapping to prioritize the horizon
Differential Revision: https://developer.blender.org/D8091
Diffstat (limited to 'intern/sky/source')
-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; |