42 g_data->studiolight_index = -1;
43 g_data->studiolight_rot_z = 0.0f;
98 fallback_rect.
xmax = vp_size[0];
99 fallback_rect.
ymax = vp_size[1];
100 fallback_rect.
xmin = fallback_rect.
ymin = 0;
101 rect = &fallback_rect;
109 const float viewport_scale =
clamp_f(
111 const int sphere_size =
U.lookdev_sphere_size *
U.dpi_fac * viewport_scale;
117 (
U.lookdev_sphere_size / 400.0f) * viewport_scale *
U.dpi_fac, 0.1f, 1.0f);
119 if (res_scale > 0.7f) {
122 else if (res_scale > 0.25f) {
154 const bool probe_render = pinfo !=
NULL;
179 (
g_data->light_cache &&
g_data->light_cache->ref_res != cube_res)) {
184 #if defined(IRRADIANCE_SH_L2)
186 #elif defined(IRRADIANCE_HL2)
191 1, 1, cube_res, 8, (
int[3]){grid_res, grid_res, 1});
213 float studiolight_matrix[3][3] = {{0.0f}};
215 float view_matrix[4][4];
216 float view_rot_matrix[3][3];
217 float x_rot_matrix[3][3];
221 mul_m3_m3m3(view_rot_matrix, x_rot_matrix, view_rot_matrix);
223 copy_m3_m3(studiolight_matrix, view_rot_matrix);
277 double ht_offset[2] = {0.0, 0.0};
278 const uint ht_primes[2] = {2, 3};
283 winmat[3][0] += ofs[0] / sphere_size;
284 winmat[3][1] += ofs[1] / sphere_size;
311 float winmat[4][4], viewmat[4][4];
342 const int sphere_margin = effects->
sphere_size / 6.0f;
343 float offset[2] = {0.0f, sphere_margin};
355 (sphere_margin + effects->
sphere_size + sphere_margin);
Camera data-block and utility functions.
@ STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE
struct StudioLight * BKE_studiolight_find(const char *name, int flag)
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag)
#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE
MINLINE float clamp_f(float value, float min, float max)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void unit_m4(float m[4][4])
bool equals_m3m3(const float mat1[3][3], const float mat2[3][3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void axis_angle_to_mat3_single(float R[3][3], char axis, float angle)
MINLINE void negate_v3(float r[3])
MINLINE void zero_v3(float r[3])
void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ LIGHTCACHE_UPDATE_WORLD
@ V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_call(shgroup, geom, ob)
#define DRW_TEXTURE_FREE_SAFE(tex)
const rcti * ED_region_visible_rect(ARegion *region)
struct GPUFrameBuffer GPUFrameBuffer
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
struct GPUShader * GPU_material_get_shader(GPUMaterial *material)
struct GPUShader GPUShader
GPUBatch * DRW_cache_sphere_get(const eDRWLevelOfDetail level_of_detail)
bool DRW_state_is_opengl_render(void)
const DRWContextState * DRW_context_state_get(void)
const float * DRW_viewport_size_get(void)
bool DRW_state_is_image_render(void)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
const DRWView * DRW_view_default_get(void)
void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float(*value)[3])
void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex, eGPUSamplerState sampler_state)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material)
void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
void DRW_view_set_active(const DRWView *view)
void DRW_stats_group_start(const char *name)
void DRW_stats_group_end(void)
static struct @318 g_data
EEVEE_ViewLayerData * EEVEE_view_layer_data_ensure(void)
LightCache * EEVEE_lightcache_create(const int grid_len, const int cube_len, const int cube_size, const int vis_size, const int irr_size[3])
void EEVEE_lookdev_init(EEVEE_Data *vedata)
static void eevee_lookdev_apply_taa(const EEVEE_EffectsInfo *effects, int sphere_size, float winmat[4][4])
static void eevee_lookdev_hdri_preview_init(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
void EEVEE_lookdev_draw(EEVEE_Data *vedata)
static void eevee_lookdev_lightcache_delete(EEVEE_Data *vedata)
void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, DRWPass *pass, EEVEE_LightProbesInfo *pinfo, DRWShadingGroup **r_shgrp)
void EEVEE_material_bind_resources(DRWShadingGroup *shgrp, GPUMaterial *gpumat, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, const int *ssr_id, const float *refract_depth, const float alpha_clip_threshold, bool use_ssrefraction, bool use_alpha_blend)
#define LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)
void EEVEE_temporal_sampling_reset(EEVEE_Data *vedata)
struct GPUShader * EEVEE_shaders_studiolight_background_sh_get(void)
Material * EEVEE_material_default_diffuse_get(void)
Material * EEVEE_material_default_glossy_get(void)
struct GPUShader * EEVEE_shaders_studiolight_probe_sh_get(void)
struct GPUMaterial * EEVEE_material_get(EEVEE_Data *vedata, struct Scene *scene, Material *ma, World *wo, int options)
BLI_INLINE bool eevee_hdri_preview_overlay_enabled(const View3D *v3d)
void EEVEE_temporal_sampling_offset_calc(const double ht_point[2], float filter_size, float r_offset[2])
void GPU_framebuffer_viewport_reset(GPUFrameBuffer *gpu_fb)
void GPU_framebuffer_viewport_set(GPUFrameBuffer *gpu_fb, int x, int y, int width, int height)
BLI_INLINE float fb(float length, float L)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_gpu_kernel_postfix ccl_global float int int int int sh
struct Depsgraph * depsgraph
EEVEE_FramebufferList * fbl
struct GPUFrameBuffer * target_buffer
eDRWLevelOfDetail sphere_lod
EEVEE_EffectsFlag enabled_effects
struct DRWView * lookdev_view
struct GPUFrameBuffer * main_fb
struct GPUFrameBuffer * effect_fb
struct GPUFrameBuffer * effect_color_fb
struct DRWPass * lookdev_diffuse_pass
struct DRWPass * lookdev_glossy_pass
LightCacheTexture * lookdev_cube_mips
EEVEE_LightProbe * lookdev_cube_data
struct EEVEE_PrivateData * g_data
struct EEVEE_EffectsInfo * effects
EEVEE_LightGrid * lookdev_grid_data
struct LightCache * lookdev_lightcache
struct GPUTexture * lookdev_cube_tx
struct GPUTexture * lookdev_grid_tx
struct EEVEE_CommonUniformBuffer common_data
struct GPUUniformBuf * common_ubo
LightGridCache * grid_data
LightProbeCache * cube_data
LightCacheTexture grid_tx
LightCacheTexture * cube_mips
LightCacheTexture cube_tx
int gi_cubemap_resolution
struct GPUTexture * equirect_radiance_gputexture
float studiolight_background
float studiolight_intensity