Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2020-07-13 02:51:13 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2020-07-13 04:08:11 +0300
commit192bd2605f2580ee221d2e304fe2dfea573753d5 (patch)
tree42428c34790faed226ad9c12e9f0b529464807a2 /intern/cycles/kernel/svm
parent41e6f9bd437cb5f23dd6a8ad41c6142b0520f65d (diff)
Cycles: Change precomputed Sky Texture mapping to prioritize the horizon
Differential Revision: https://developer.blender.org/D8091
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/svm_sky.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/kernel/svm/svm_sky.h b/intern/cycles/kernel/svm/svm_sky.h
index 45b76fab007..be2c8ccdacf 100644
--- a/intern/cycles/kernel/svm/svm_sky.h
+++ b/intern/cycles/kernel/svm/svm_sky.h
@@ -152,7 +152,7 @@ ccl_device float3 sky_radiance_nishita(KernelGlobals *kg,
/* if ray inside sun disc render it, otherwise render sky */
if (sun_disc && sun_dir_angle < half_angular) {
- /* get 3 pixels data */
+ /* get 2 pixels data */
float3 pixel_bottom = make_float3(nishita_data[0], nishita_data[1], nishita_data[2]);
float3 pixel_top = make_float3(nishita_data[3], nishita_data[4], nishita_data[5]);
float y;
@@ -179,7 +179,8 @@ ccl_device float3 sky_radiance_nishita(KernelGlobals *kg,
else {
/* sky interpolation */
float x = (direction.y + M_PI_F + sun_rotation) / M_2PI_F;
- float y = dir_elevation / M_PI_2_F;
+ /* more pixels toward horizon compensation */
+ float y = safe_sqrtf(dir_elevation / M_PI_2_F);
if (x > 1.0f) {
x -= 1.0f;
}