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:
authorClément Foucault <foucault.clem@gmail.com>2018-11-19 03:01:43 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-19 17:48:17 +0300
commitee44dd1b2bcff6bbd99084a012a40fb4a7100b2c (patch)
tree36975c1ff675bf4b57f3750105bac4ae02eafa24 /source/blender/draw/engines/workbench/workbench_studiolight.c
parent8d51e3c062dda1317586d744fcb8ff223ec0939a (diff)
Studio Lights: Big Cleanups
* Less Lengthy enum/macro names. * Optimize computation of Spherical Harmonics. * Reduce radiance cubemap size a bit. Higher resolution is not necessary. * Remove STUDIOLIGHT_LIGHT_DIRECTION_CALCULATED (was not used). * Do windowing on each component separately instead of using luminance. * Use ITER_PIXELS to iterate on each pixels, using pixel center coords. * Remove gpu_matcap_3components as it is only needed when creating the gputex. * Fix a lot of confusion in axis denomination/swizzle. These changes should not affect functionallity.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_studiolight.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_studiolight.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c
index f9e5df91388..c852d7abb90 100644
--- a/source/blender/draw/engines/workbench/workbench_studiolight.c
+++ b/source/blender/draw/engines/workbench/workbench_studiolight.c
@@ -34,15 +34,12 @@
void studiolight_update_world(StudioLight *sl, WORKBENCH_UBO_World *wd)
{
- int i;
BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED);
- for (i = 0; i < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; i++) {
+ for (int i = 0; i < STUDIOLIGHT_SH_EFFECTIVE_COEFS_LEN; i++) {
+ /* Can't memcpy because of alignment */
copy_v3_v3(wd->spherical_harmonics_coefs[i], sl->spherical_harmonics_coefs[i]);
}
- for (; i < STUDIOLIGHT_SPHERICAL_HARMONICS_MAX_COMPONENTS; i++) {
- copy_v3_fl(wd->spherical_harmonics_coefs[i], 0.0);
- }
}
static void compute_parallel_lines_nor_and_dist(const float v1[2], const float v2[2], const float v3[2], float r_line[2])