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.
This commit is contained in:
2018-11-19 01:01:43 +01:00
parent 8d51e3c062
commit ee44dd1b2b
11 changed files with 485 additions and 587 deletions

View File

@@ -726,7 +726,7 @@ static void rna_UserDef_studiolight_spherical_harmonics_coefficients_get(Pointer
{
StudioLight *sl = (StudioLight *)ptr->data;
float *value = values;
for (int i = 0; i < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; i++) {
for (int i = 0; i < STUDIOLIGHT_SH_EFFECTIVE_COEFS_LEN; i++) {
copy_v3_v3(value, sl->spherical_harmonics_coefs[i]);
value += 3;
}
@@ -3379,7 +3379,7 @@ static void rna_def_userdef_studiolight(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "SH Cache Path", "Path where the spherical harmonics cache is stored");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
const int spherical_harmonics_dim[] = {STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS, 3};
const int spherical_harmonics_dim[] = {STUDIOLIGHT_SH_EFFECTIVE_COEFS_LEN, 3};
prop = RNA_def_property(srna, "spherical_harmonics_coefficients", PROP_FLOAT, PROP_COLOR);
RNA_def_property_multi_array(prop, 2, spherical_harmonics_dim);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);