|
Blender
V2.93
|
#include "BKE_studiolight.h"#include "BKE_appdir.h"#include "BKE_icons.h"#include "BLI_dynstr.h"#include "BLI_fileops.h"#include "BLI_fileops_types.h"#include "BLI_linklist.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_math_color.h"#include "BLI_path_util.h"#include "BLI_string.h"#include "BLI_string_utils.h"#include "DNA_listBase.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "GPU_texture.h"#include "MEM_guardedalloc.h"#include "intern/openexr/openexr_multi.h"Go to the source code of this file.
Classes | |
| struct | MultilayerConvertContext |
Typedefs | |
| typedef struct MultilayerConvertContext | MultilayerConvertContext |
Variables | |
| static ListBase | studiolights |
| static int | last_studiolight_id = 0 |
| static const char * | STUDIOLIGHT_LIGHTS_FOLDER = "studiolights/studio/" |
| static const char * | STUDIOLIGHT_WORLD_FOLDER = "studiolights/world/" |
| static const char * | STUDIOLIGHT_MATCAP_FOLDER = "studiolights/matcap/" |
| static const char * | STUDIOLIGHT_WORLD_DEFAULT = "forest.exr" |
| static const char * | STUDIOLIGHT_MATCAP_DEFAULT = "basic_1.exr" |
| #define GPU_TEXTURE_SAFE_FREE | ( | p | ) |
Definition at line 115 of file studiolight.c.
| #define IMB_SAFE_FREE | ( | p | ) |
Definition at line 107 of file studiolight.c.
Iter on all pixel giving texel center position and pixel pointer.
Arguments type : type of src. src : source buffer. channels : number of channels per pixel.
Others x, y : normalized UV coordinate [0..1] of the current pixel center. texel_size[2] : UV size of a pixel in this texture. pixel[] : pointer to the current pixel.
Definition at line 90 of file studiolight.c.
| #define ITER_PIXELS_END |
Definition at line 100 of file studiolight.c.
Definition at line 200 of file studiolight.c.
Definition at line 201 of file studiolight.c.
| #define READ_SOLIDLIGHT | ( | sl, | |
| i, | |||
| lines | |||
| ) |
Definition at line 210 of file studiolight.c.
Definition at line 189 of file studiolight.c.
| #define READ_VEC3 | ( | id, | |
| val, | |||
| lines | |||
| ) |
Definition at line 203 of file studiolight.c.
| #define RESCALE_COORD | ( | x | ) | (x / STUDIOLIGHT_DIAMETER - (1.0f - STUDIOLIGHT_DIAMETER) / 2.0f) |
Definition at line 1249 of file studiolight.c.
| #define STUDIOLIGHT_DELETE_ICON | ( | s | ) |
| #define STUDIOLIGHT_DIAMETER 0.95f |
Definition at line 1247 of file studiolight.c.
| #define STUDIOLIGHT_FILE_VERSION 1 |
Definition at line 187 of file studiolight.c.
| #define STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT 32 |
Definition at line 55 of file studiolight.c.
| #define STUDIOLIGHT_IRRADIANCE_EQUIRECT_WIDTH (STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT * 2) |
Definition at line 56 of file studiolight.c.
| #define STUDIOLIGHT_LOAD_CACHED_FILES |
Definition at line 66 of file studiolight.c.
| #define STUDIOLIGHT_PASSNAME_DIFFUSE "diffuse" |
Definition at line 57 of file studiolight.c.
| #define STUDIOLIGHT_PASSNAME_SPECULAR "specular" |
Definition at line 58 of file studiolight.c.
| #define STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE 96 |
Definition at line 54 of file studiolight.c.
| #define STUDIOLIGHT_SH_WINDOWING 0.0f /* 0.0 is disabled */ |
Definition at line 60 of file studiolight.c.
| #define WRITE_FVAL | ( | str, | |
| id, | |||
| val | |||
| ) | (BLI_dynstr_appendf(str, id " %f\n", val)) |
Definition at line 237 of file studiolight.c.
| #define WRITE_IVAL | ( | str, | |
| id, | |||
| val | |||
| ) | (BLI_dynstr_appendf(str, id " %d\n", val)) |
Definition at line 238 of file studiolight.c.
| #define WRITE_SOLIDLIGHT | ( | str, | |
| sl, | |||
| i | |||
| ) |
Definition at line 247 of file studiolight.c.
Definition at line 240 of file studiolight.c.
| typedef struct MultilayerConvertContext MultilayerConvertContext |
Definition at line 1236 of file studiolight.c.
References alpha, floorf, len_v2(), mask(), max_ff(), min_ff(), and v.
Referenced by studiolight_irradiance_preview(), studiolight_matcap_preview(), and studiolight_radiance_preview().
| BLI_INLINE float area_element | ( | float | x, |
| float | y | ||
| ) |
Definition at line 662 of file studiolight.c.
References KDL::atan2(), sqrtf, x, and y.
Referenced by texel_solid_angle().
| StudioLight* BKE_studiolight_create | ( | const char * | path, |
| const SolidLight | light[4], | ||
| const float | light_ambient[3] | ||
| ) |
Definition at line 1592 of file studiolight.c.
References BLI_addtail(), BLI_split_file_part(), FILE_MAXFILE, StudioLight::light, StudioLight::light_ambient, StudioLight::name, StudioLight::path, STRNCPY, studiolight_create(), STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS, STUDIOLIGHT_TYPE_STUDIO, STUDIOLIGHT_USER_DEFINED, studiolight_write_solid_light(), and studiolights.
| void BKE_studiolight_default | ( | SolidLight | lights[4], |
| float | light_ambient[4] | ||
| ) |
Definition at line 1355 of file studiolight.c.
References SolidLight::col, copy_v3_fl3(), SolidLight::flag, SolidLight::smooth, SolidLight::spec, and SolidLight::vec.
Referenced by BKE_blendfile_userdef_from_defaults(), and BKE_studiolight_init().
| void BKE_studiolight_ensure_flag | ( | StudioLight * | sl, |
| int | flag | ||
| ) |
Definition at line 1539 of file studiolight.c.
References StudioLight::flag, studiolight_calculate_diffuse_light(), studiolight_calculate_irradiance_equirect_image(), studiolight_calculate_radiance_cubemap_buffers(), studiolight_create_equirect_irradiance_gputexture(), studiolight_create_equirect_radiance_gputexture(), studiolight_create_matcap_diffuse_gputexture(), studiolight_create_matcap_specular_gputexture(), STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE, STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED, STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, studiolight_load_equirect_image(), studiolight_load_irradiance_equirect_image(), studiolight_load_spherical_harmonics_coefficients(), STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE, STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE, STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED, and STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED.
Referenced by EEVEE_lookdev_cache_init(), studiolight_calculate_diffuse_light(), studiolight_calculate_irradiance_equirect_image(), studiolight_calculate_radiance_cubemap_buffers(), studiolight_create_equirect_irradiance_gputexture(), studiolight_create_equirect_radiance_gputexture(), studiolight_create_matcap_diffuse_gputexture(), studiolight_create_matcap_specular_gputexture(), studiolight_matcap_preview(), studiolight_radiance_preview(), workbench_opaque_cache_init(), and workbench_transparent_lighting_uniforms().
| struct StudioLight* BKE_studiolight_find | ( | const char * | name, |
| int | flag | ||
| ) |
Definition at line 1483 of file studiolight.c.
References BKE_studiolight_find_default(), FILE_MAXFILE, StudioLight::flag, LISTBASE_FOREACH, StudioLight::name, STREQLEN, and studiolights.
Referenced by blo_do_versions_280(), EEVEE_lookdev_cache_init(), and workbench_private_data_init().
| struct StudioLight* BKE_studiolight_find_default | ( | int | flag | ) |
Definition at line 1458 of file studiolight.c.
References StudioLight::flag, LISTBASE_FOREACH, StudioLight::name, NULL, STREQ, STUDIOLIGHT_MATCAP_DEFAULT, STUDIOLIGHT_TYPE_MATCAP, STUDIOLIGHT_TYPE_WORLD, STUDIOLIGHT_WORLD_DEFAULT, and studiolights.
Referenced by BKE_studiolight_find(), BKE_studiolight_findindex(), and blo_do_versions_280().
| struct StudioLight* BKE_studiolight_findindex | ( | int | index, |
| int | flag | ||
| ) |
Definition at line 1499 of file studiolight.c.
References BKE_studiolight_find_default(), StudioLight::flag, StudioLight::index, LISTBASE_FOREACH, and studiolights.
| void BKE_studiolight_free | ( | void | ) |
Definition at line 1450 of file studiolight.c.
References BLI_pophead(), studiolight_free(), and studiolights.
Referenced by BKE_blender_free(), and BKE_studiolight_refresh().
| void BKE_studiolight_init | ( | void | ) |
Definition at line 1409 of file studiolight.c.
References BKE_appdir_app_is_portable_install(), BKE_studiolight_default(), BLENDER_SYSTEM_DATAFILES, BLENDER_USER_DATAFILES, BLI_addtail(), BLI_listbase_sort(), BLI_strncpy(), FILE_MAXFILE, StudioLight::light, StudioLight::light_ambient, StudioLight::name, studiolight_add_files_from_datafolder(), studiolight_cmp(), studiolight_create(), STUDIOLIGHT_INTERNAL, STUDIOLIGHT_LIGHTS_FOLDER, STUDIOLIGHT_MATCAP_FOLDER, STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS, STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED, STUDIOLIGHT_TYPE_MATCAP, STUDIOLIGHT_TYPE_STUDIO, STUDIOLIGHT_TYPE_WORLD, STUDIOLIGHT_USER_DEFINED, STUDIOLIGHT_WORLD_FOLDER, and studiolights.
Referenced by BKE_studiolight_refresh(), and WM_init().
| struct ListBase* BKE_studiolight_listbase | ( | void | ) |
Definition at line 1510 of file studiolight.c.
References studiolights.
| StudioLight* BKE_studiolight_load | ( | const char * | path, |
| int | type | ||
| ) |
Definition at line 1586 of file studiolight.c.
References studiolight_add_file(), STUDIOLIGHT_USER_DEFINED, and type.
| void BKE_studiolight_preview | ( | uint * | icon_buffer, |
| StudioLight * | sl, | ||
| int | icon_id_type | ||
| ) |
Definition at line 1515 of file studiolight.c.
References STUDIOLIGHT_ICON_ID_TYPE_IRRADIANCE, STUDIOLIGHT_ICON_ID_TYPE_MATCAP, STUDIOLIGHT_ICON_ID_TYPE_MATCAP_FLIPPED, STUDIOLIGHT_ICON_ID_TYPE_RADIANCE, studiolight_irradiance_preview(), studiolight_matcap_preview(), and studiolight_radiance_preview().
Referenced by ui_studiolight_icon_job_exec().
| void BKE_studiolight_refresh | ( | void | ) |
Definition at line 1626 of file studiolight.c.
References BKE_studiolight_free(), and BKE_studiolight_init().
| void BKE_studiolight_remove | ( | StudioLight * | sl | ) |
Definition at line 1578 of file studiolight.c.
References BLI_remlink(), StudioLight::flag, studiolight_free(), STUDIOLIGHT_USER_DEFINED, and studiolights.
| void BKE_studiolight_set_free_function | ( | StudioLight * | sl, |
| StudioLightFreeFunction * | free_function, | ||
| void * | data | ||
| ) |
Definition at line 1632 of file studiolight.c.
References data, StudioLight::free_function, and StudioLight::free_function_data.
Referenced by ui_icon_ensure_deferred(), and ui_studiolight_icon_job_end().
| StudioLight* BKE_studiolight_studio_edit_get | ( | void | ) |
Definition at line 1615 of file studiolight.c.
References StudioLight::flag, StudioLight::light, StudioLight::light_ambient, STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS, and STUDIOLIGHT_TYPE_STUDIO.
Referenced by workbench_studiolight_data_update().
| void BKE_studiolight_unset_icon_id | ( | StudioLight * | sl, |
| int | icon_id | ||
| ) |
Definition at line 1640 of file studiolight.c.
References BLI_assert, StudioLight::icon_id_irradiance, StudioLight::icon_id_matcap, StudioLight::icon_id_matcap_flipped, StudioLight::icon_id_radiance, and NULL.
Referenced by icon_free_data().
|
static |
Definition at line 1021 of file studiolight.c.
References add_v3_v3v3(), dot_v3v3(), I, L, max_ff(), N, NL, normalize_v3(), powf, R, usdtokens::roughness(), w(), blender::gpu::wrap(), and wrapped_lighting().
Referenced by studiolight_lights_eval().
Definition at line 1006 of file studiolight.c.
References usdtokens::roughness().
Referenced by studiolight_lights_eval().
Definition at line 327 of file studiolight.c.
References copy_v3_fl3(), mul_m3_v3(), normalize_v3(), x, and y.
Referenced by studiolight_calculate_cubemap_vector_weight().
|
static |
Definition at line 301 of file studiolight.c.
References fabsf, STUDIOLIGHT_X_NEG, STUDIOLIGHT_X_POS, STUDIOLIGHT_Y_NEG, STUDIOLIGHT_Y_POS, STUDIOLIGHT_Z_NEG, and STUDIOLIGHT_Z_POS.
Definition at line 285 of file studiolight.c.
References acosf, atan2f, M_PI, and r.
Referenced by studiolight_calculate_radiance().
Definition at line 291 of file studiolight.c.
References cosf, M_PI, r, sinf, and v.
Referenced by studiolight_calculate_irradiance_equirect_image().
Definition at line 1252 of file studiolight.c.
References len_v2(), normal, sqrtf, square_f(), and v.
Referenced by studiolight_irradiance_preview(), and studiolight_radiance_preview().
|
static |
Definition at line 1161 of file studiolight.c.
References BLI_addtail(), BLI_path_extension_check(), BLI_path_extension_check_array(), BLI_split_file_part(), BLI_string_joinN, BLI_strncpy(), FILE_MAXFILE, imb_ext_image, StudioLight::name, NULL, StudioLight::path, StudioLight::path_irr_cache, StudioLight::path_sh_cache, studiolight_create(), STUDIOLIGHT_EXTERNAL_FILE, studiolight_load_solid_light(), STUDIOLIGHT_TYPE_STUDIO, and studiolights.
Referenced by BKE_studiolight_load(), and studiolight_add_files_from_datafolder().
|
static |
Definition at line 1185 of file studiolight.c.
References BKE_appdir_folder_id(), BLI_filelist_dir_contents(), BLI_filelist_free(), NULL, direntry::path, studiolight_add_file(), and type.
Referenced by BKE_studiolight_init().
|
static |
Definition at line 678 of file studiolight.c.
References cube_face_uv_to_direction(), normal, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, texel_solid_angle(), x, and y.
Referenced by studiolight_spherical_harmonics_calculate_coefficients().
|
static |
Definition at line 950 of file studiolight.c.
References BKE_studiolight_ensure_flag(), BLI_fopen(), StudioLight::flag, StudioLight::path_sh_cache, StudioLight::spherical_harmonics_coefs, STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED, STUDIOLIGHT_SH_COEFS_LEN, STUDIOLIGHT_SH_WINDOWING, studiolight_spherical_harmonics_apply_band_factors(), studiolight_spherical_harmonics_apply_windowing(), studiolight_spherical_harmonics_calculate_coefficients(), STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED, and STUDIOLIGHT_USER_DEFINED.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 1130 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::equirect_irradiance_buffer, equirect_to_direction(), StudioLight::flag, IMB_allocFromBuffer(), ITER_PIXELS, ITER_PIXELS_END, MEM_freeN, MEM_mallocN, NULL, STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED, STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT, STUDIOLIGHT_IRRADIANCE_EQUIRECT_WIDTH, STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED, studiolight_spherical_harmonics_eval(), x, and y.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 566 of file studiolight.c.
References direction_to_equirect(), nearest_interpolation_color_wrap(), NULL, ImBuf::x, and ImBuf::y.
Referenced by studiolight_calculate_radiance_buffer(), and studiolight_radiance_preview().
|
static |
Definition at line 573 of file studiolight.c.
References ITER_PIXELS, ITER_PIXELS_END, normalize_v3(), studiolight_calculate_radiance(), STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, x, and y.
Referenced by studiolight_calculate_radiance_cubemap_buffers().
|
static |
Definition at line 594 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::equirect_radiance_buffer, StudioLight::flag, IB_rectfloat, IMB_allocFromBuffer(), IMB_saveiff(), MEM_freeN, MEM_malloc_arrayN, NULL, StudioLight::radiance_cubemap_buffers, square_i(), studiolight_calculate_radiance_buffer(), STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_X_NEG, STUDIOLIGHT_X_POS, STUDIOLIGHT_Y_NEG, STUDIOLIGHT_Y_POS, STUDIOLIGHT_Z_NEG, and STUDIOLIGHT_Z_POS.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 1213 of file studiolight.c.
References Freestyle::a, BLI_strcasecmp(), StudioLight::name, and studiolight_flag_cmp_order().
Referenced by BKE_studiolight_init().
|
static |
Definition at line 158 of file studiolight.c.
References BKE_icon_ensure_studio_light(), StudioLight::flag, StudioLight::free_function, StudioLight::icon_id_irradiance, StudioLight::icon_id_matcap, StudioLight::icon_id_matcap_flipped, StudioLight::icon_id_radiance, StudioLight::index, last_studiolight_id, MEM_callocN, StudioLight::name, NULL, StudioLight::path, StudioLight::path_irr_cache, StudioLight::path_sh_cache, StudioLight::radiance_cubemap_buffers, STUDIOLIGHT_ICON_ID_TYPE_IRRADIANCE, STUDIOLIGHT_ICON_ID_TYPE_MATCAP, STUDIOLIGHT_ICON_ID_TYPE_MATCAP_FLIPPED, STUDIOLIGHT_ICON_ID_TYPE_RADIANCE, STUDIOLIGHT_TYPE_MATCAP, and STUDIOLIGHT_TYPE_STUDIO.
Referenced by BKE_studiolight_create(), BKE_studiolight_init(), and studiolight_add_file().
|
static |
Definition at line 552 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::equirect_irradiance_buffer, StudioLight::equirect_irradiance_gputexture, StudioLight::flag, GPU_RGBA16F, GPU_texture_create_2d(), GPU_texture_filter_mode(), GPU_texture_wrap_mode(), ImBuf::rect_float, STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE, STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED, STUDIOLIGHT_EXTERNAL_FILE, tex, ImBuf::x, and ImBuf::y.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 496 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::equirect_radiance_buffer, StudioLight::equirect_radiance_gputexture, StudioLight::flag, GPU_RGBA16F, GPU_texture_create_2d(), GPU_texture_filter_mode(), GPU_texture_wrap_mode(), ImBuf::rect_float, STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE, STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, tex, ImBuf::x, and ImBuf::y.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 529 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::flag, StudioLight::matcap_diffuse, studiolight_create_matcap_gputexture(), STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE, and STUDIOLIGHT_TYPE_MATCAP.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 511 of file studiolight.c.
References BLI_assert, copy_v3_v3(), float(), GPU_DATA_FLOAT, GPU_R11F_G11F_B10F, GPU_texture_create_2d(), GPU_texture_update(), StudioLightImage::gputexture, StudioLightImage::ibuf, MEM_callocN, MEM_SAFE_FREE, NULL, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by studiolight_create_matcap_diffuse_gputexture(), and studiolight_create_matcap_specular_gputexture().
|
static |
Definition at line 539 of file studiolight.c.
References BKE_studiolight_ensure_flag(), StudioLight::flag, StudioLightImage::ibuf, StudioLight::matcap_specular, studiolight_create_matcap_gputexture(), STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE, and STUDIOLIGHT_TYPE_MATCAP.
Referenced by BKE_studiolight_ensure_flag().
| BLI_INLINE void studiolight_evaluate_specular_radiance_buffer | ( | ImBuf * | radiance_buffer, |
| const float | normal[3], | ||
| float | color[3], | ||
| int | xoffset, | ||
| int | yoffset, | ||
| int | zoffset, | ||
| float | zsign | ||
| ) |
Definition at line 972 of file studiolight.c.
References dot_v3v3(), ITER_PIXELS, ITER_PIXELS_END, madd_v3_v3fl(), normal, normalize_v3(), NULL, ImBuf::rect_float, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, x, and y.
|
static |
Definition at line 1204 of file studiolight.c.
References StudioLight::flag, and STUDIOLIGHT_EXTERNAL_FILE.
Referenced by studiolight_cmp().
|
static |
Definition at line 123 of file studiolight.c.
References StudioLight::equirect_irradiance_buffer, StudioLight::equirect_irradiance_gputexture, StudioLight::equirect_radiance_buffer, StudioLight::equirect_radiance_gputexture, StudioLight::free_function, StudioLight::free_function_data, GPU_TEXTURE_SAFE_FREE, StudioLightImage::gputexture, StudioLightImage::ibuf, StudioLight::icon_id_irradiance, StudioLight::icon_id_matcap, StudioLight::icon_id_matcap_flipped, StudioLight::icon_id_radiance, IMB_SAFE_FREE, StudioLight::matcap_diffuse, StudioLight::matcap_specular, MEM_SAFE_FREE, StudioLight::path_irr_cache, StudioLight::path_sh_cache, StudioLight::radiance_cubemap_buffers, and STUDIOLIGHT_DELETE_ICON.
Referenced by BKE_studiolight_free(), and BKE_studiolight_remove().
|
static |
Definition at line 1327 of file studiolight.c.
References alpha_circle_mask(), ITER_PIXELS, ITER_PIXELS_END, linearrgb_to_srgb(), normal, RESCALE_COORD, rgb_to_cpack(), sphere_normal_from_uv(), STUDIOLIGHT_ICON_SIZE, studiolight_lights_eval(), SWAP, texel_size, x, and y.
Referenced by BKE_studiolight_preview().
|
static |
Definition at line 1055 of file studiolight.c.
References add_v3_v3v3(), blinn_specular(), brdf_approx(), SolidLight::col, copy_v3_v3(), KDL::diff(), usdtokens::diffuse_color(), dot_v3v3(), SolidLight::flag, I, StudioLight::light, StudioLight::light_ambient, madd_v3_v3fl(), mul_v3_fl(), N, NL, normal, R, reflect_v3_v3v3(), usdtokens::roughness(), SolidLight::smooth, SolidLight::spec, STUDIOLIGHT_MAX_LIGHT, SolidLight::vec, and wrapped_lighting().
Referenced by studiolight_irradiance_preview().
|
static |
Definition at line 412 of file studiolight.c.
References MultilayerConvertContext::diffuse_pass, StudioLight::equirect_radiance_buffer, StudioLight::flag, ImBuf::ftype, IB_multilayer, StudioLightImage::ibuf, IMB_allocFromBuffer(), IMB_exr_close(), IMB_exr_multilayer_convert(), IMB_float_from_rect(), IMB_freeImBuf(), IMB_FTYPE_OPENEXR, IMB_loadiffname(), StudioLight::matcap_diffuse, StudioLight::matcap_specular, MEM_freeN, NULL, MultilayerConvertContext::num_diffuse_channels, MultilayerConvertContext::num_specular_channels, StudioLight::path, MultilayerConvertContext::specular_pass, STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, studiolight_multilayer_addlayer(), studiolight_multilayer_addpass(), studiolight_multilayer_addview(), studiolight_multilayer_convert_pass(), STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS, STUDIOLIGHT_TYPE_MATCAP, ImBuf::userdata, ImBuf::x, and ImBuf::y.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 1088 of file studiolight.c.
References StudioLight::equirect_irradiance_buffer, StudioLight::flag, IMB_float_from_rect(), IMB_loadiffname(), NULL, StudioLight::path_irr_cache, STUDIOLIGHT_EQUIRECT_IRRADIANCE_IMAGE_CALCULATED, STUDIOLIGHT_EXTERNAL_FILE, and UNUSED_VARS.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 219 of file studiolight.c.
References BLI_file_free_lines(), BLI_file_read_as_lines(), StudioLight::light, StudioLight::light_ambient, StudioLight::path, READ_SOLIDLIGHT, and READ_VEC3.
Referenced by studiolight_add_file().
|
static |
Definition at line 1107 of file studiolight.c.
References BLI_fopen(), StudioLight::flag, StudioLight::path_sh_cache, StudioLight::spherical_harmonics_coefs, STUDIOLIGHT_EXTERNAL_FILE, STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED, and UNUSED_VARS.
Referenced by BKE_studiolight_ensure_flag().
|
static |
Definition at line 1292 of file studiolight.c.
References add_v3_v3(), alpha_circle_mask(), BKE_studiolight_ensure_flag(), StudioLightImage::ibuf, ITER_PIXELS, ITER_PIXELS_END, linearrgb_to_srgb(), StudioLight::matcap_diffuse, StudioLight::matcap_specular, nearest_interpolation_color(), NULL, RESCALE_COORD, rgb_to_cpack(), STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, STUDIOLIGHT_ICON_SIZE, texel_size, v, x, ImBuf::x, y, and ImBuf::y.
Referenced by BKE_studiolight_preview().
|
static |
Definition at line 354 of file studiolight.c.
Referenced by studiolight_load_equirect_image().
|
static |
Definition at line 387 of file studiolight.c.
References MultilayerConvertContext::diffuse_pass, MEM_freeN, MultilayerConvertContext::num_diffuse_channels, MultilayerConvertContext::num_specular_channels, MultilayerConvertContext::specular_pass, STREQ, STUDIOLIGHT_PASSNAME_DIFFUSE, and STUDIOLIGHT_PASSNAME_SPECULAR.
Referenced by studiolight_load_equirect_image().
|
static |
Definition at line 350 of file studiolight.c.
References NULL.
Referenced by studiolight_load_equirect_image().
|
static |
Definition at line 362 of file studiolight.c.
References IB_PROFILE_LINEAR_RGB, IMB_buffer_float_from_float(), MEM_callocN, MEM_freeN, ImBuf::x, and ImBuf::y.
Referenced by studiolight_load_equirect_image().
|
static |
Definition at line 1260 of file studiolight.c.
References alpha_circle_mask(), BKE_studiolight_ensure_flag(), StudioLight::equirect_radiance_buffer, ITER_PIXELS, ITER_PIXELS_END, linearrgb_to_srgb(), normal, reflect_v3_v3v3(), RESCALE_COORD, rgb_to_cpack(), sphere_normal_from_uv(), studiolight_calculate_radiance(), STUDIOLIGHT_EXTERNAL_IMAGE_LOADED, STUDIOLIGHT_ICON_SIZE, SWAP, texel_size, x, and y.
Referenced by BKE_studiolight_preview().
|
static |
Definition at line 927 of file studiolight.c.
References mul_v3_v3fl(), StudioLight::spherical_harmonics_coefs, square_i(), and STUDIOLIGHT_SH_BANDS.
Referenced by studiolight_calculate_diffuse_light().
|
static |
Definition at line 806 of file studiolight.c.
References mul_v3_v3(), square_i(), STUDIOLIGHT_SH_BANDS, STUDIOLIGHT_SH_COEFS_LEN, and studiolight_spherical_harmonics_lambda_get().
Referenced by studiolight_calculate_diffuse_light().
|
static |
Definition at line 686 of file studiolight.c.
References ITER_PIXELS, ITER_PIXELS_END, M_PI, madd_v3_v3fl(), mul_v3_fl(), mul_v3_v3fl(), ny, StudioLight::radiance_cubemap_buffers, ImBuf::rect_float, studiolight_calculate_cubemap_vector_weight(), STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_SH_COEFS_LEN, x, and y.
Referenced by studiolight_calculate_diffuse_light().
| BLI_INLINE void studiolight_spherical_harmonics_eval | ( | StudioLight * | sl, |
| float | color[3], | ||
| const float | normal[3] | ||
| ) |
Definition at line 860 of file studiolight.c.
References float(), madd_v3_v3fl(), mul_v3_v3fl(), normal, ny, StudioLight::spherical_harmonics_coefs, and studiolight_spherical_harmonics_geomerics_eval().
Referenced by studiolight_calculate_irradiance_equirect_image().
|
static |
Definition at line 840 of file studiolight.c.
References Freestyle::a, dot_v3v3(), len_v3(), M_1_PI, mul_v3_fl(), normal, and powf.
Referenced by studiolight_spherical_harmonics_eval().
Definition at line 750 of file studiolight.c.
References cube_f(), fabsf, float(), square_f(), square_i(), and STUDIOLIGHT_SH_BANDS.
Referenced by studiolight_spherical_harmonics_apply_windowing().
|
static |
Definition at line 256 of file studiolight.c.
References BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_get_len(), BLI_dynstr_new(), BLI_fopen(), StudioLight::light, StudioLight::light_ambient, MEM_freeN, StudioLight::path, str, STUDIOLIGHT_FILE_VERSION, WRITE_IVAL, WRITE_SOLIDLIGHT, and WRITE_VEC3.
Referenced by BKE_studiolight_create().
| BLI_INLINE float texel_solid_angle | ( | float | x, |
| float | y, | ||
| float | halfpix | ||
| ) |
Definition at line 667 of file studiolight.c.
References area_element(), x, and y.
Referenced by studiolight_calculate_cubemap_vector_weight().
Definition at line 1015 of file studiolight.c.
References max_ff(), NL, and w().
Referenced by blinn_specular(), and studiolight_lights_eval().
|
static |
Definition at line 53 of file studiolight.c.
Referenced by studiolight_create().
|
static |
Definition at line 68 of file studiolight.c.
Referenced by BKE_studiolight_init().
|
static |
Definition at line 73 of file studiolight.c.
Referenced by BKE_studiolight_find_default().
|
static |
Definition at line 70 of file studiolight.c.
Referenced by BKE_studiolight_init().
|
static |
Definition at line 72 of file studiolight.c.
Referenced by BKE_studiolight_find_default().
|
static |
Definition at line 69 of file studiolight.c.
Referenced by BKE_studiolight_init().
|
static |
Definition at line 52 of file studiolight.c.
Referenced by BKE_studiolight_create(), BKE_studiolight_find(), BKE_studiolight_find_default(), BKE_studiolight_findindex(), BKE_studiolight_free(), BKE_studiolight_init(), BKE_studiolight_listbase(), BKE_studiolight_remove(), and studiolight_add_file().