diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 00:53:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 00:53:00 +0300 |
commit | f0b5a9da017a00c094cb7ab8bd0aa289c921a117 (patch) | |
tree | 8e8906352a5ec6da55073a75de067448158c08c1 /source/blender/draw/engines/workbench/workbench_studiolight.c | |
parent | 8617594515e685303da51282ae50ccf0ebd030ef (diff) |
Cleanup: style, unused
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_studiolight.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_studiolight.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c index 65732b52471..901260d0660 100644 --- a/source/blender/draw/engines/workbench/workbench_studiolight.c +++ b/source/blender/draw/engines/workbench/workbench_studiolight.c @@ -41,18 +41,20 @@ void studiolight_update_world(StudioLight *sl, WORKBENCH_UBO_World *wd) mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI); /* Swizzle to make shader code simpler. */ for (int i = 0; i < 3; ++i) { - copy_v3_fl3(wd->spherical_harmonics_coefs[i+1], -sl->spherical_harmonics_coefs[3][i], - sl->spherical_harmonics_coefs[2][i], - -sl->spherical_harmonics_coefs[1][i]); - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ + copy_v3_fl3( + wd->spherical_harmonics_coefs[i + 1], + -sl->spherical_harmonics_coefs[3][i], + sl->spherical_harmonics_coefs[2][i], + -sl->spherical_harmonics_coefs[1][i]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ } /* Precompute as much as we can. See shader code for derivation. */ float len_r1[3], lr1_r0[3], p[3], a[3]; for (int i = 0; i < 3; ++i) { - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], 0.5f); - len_r1[i] = len_v3(wd->spherical_harmonics_coefs[i+1]); - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], 1.0f / len_r1[i]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 0.5f); + len_r1[i] = len_v3(wd->spherical_harmonics_coefs[i + 1]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 1.0f / len_r1[i]); } /* lr1_r0 = lenR1 / R0; */ copy_v3_v3(lr1_r0, wd->spherical_harmonics_coefs[0]); |