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/cycles/kernel/shaders | |
parent | 41e6f9bd437cb5f23dd6a8ad41c6142b0520f65d (diff) |
Cycles: Change precomputed Sky Texture mapping to prioritize the horizon
Differential Revision: https://developer.blender.org/D8091
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/node_sky_texture.osl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/kernel/shaders/node_sky_texture.osl b/intern/cycles/kernel/shaders/node_sky_texture.osl index cbb37effc9d..acb198a9852 100644 --- a/intern/cycles/kernel/shaders/node_sky_texture.osl +++ b/intern/cycles/kernel/shaders/node_sky_texture.osl @@ -150,7 +150,7 @@ color sky_radiance_nishita(vector dir, float nishita_data[10], string filename) /* if ray inside sun disc render it, otherwise render sky */ if (sun_dir_angle < half_angular && sun_disc == 1) { - /* get 3 pixels data */ + /* get 2 pixels data */ color pixel_bottom = color(nishita_data[0], nishita_data[1], nishita_data[2]); color pixel_top = color(nishita_data[3], nishita_data[4], nishita_data[5]); float y; @@ -177,7 +177,8 @@ color sky_radiance_nishita(vector dir, float nishita_data[10], string filename) else { /* sky interpolation */ float x = (direction[1] + M_PI + sun_rotation) / M_2PI; - float y = 1.0 - (dir_elevation / M_PI_2); + /* more pixels toward horizon compensation */ + float y = 1.0 - sqrt(dir_elevation / M_PI_2); if (x > 1.0) { x = x - 1.0; } |