Blender
V3.3
|
#include "eevee_private.h"
Go to the source code of this file.
Functions | |
void | EEVEE_shadows_cube_add (EEVEE_LightsInfo *linfo, EEVEE_Light *evli, Object *ob) |
static void | shadow_cube_random_position_set (const EEVEE_Light *evli, int sample_ofs, float ws_sample_pos[3]) |
bool | EEVEE_shadows_cube_setup (EEVEE_LightsInfo *linfo, const EEVEE_Light *evli, int sample_ofs) |
static void | eevee_ensure_cube_views (float near, float far, int cube_res, const float viewmat[4][4], DRWView *view[6]) |
static bool | spot_angle_fit_single_face (const EEVEE_Light *evli) |
void | EEVEE_shadows_draw_cubemap (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, int cube_index) |
|
static |
Definition at line 123 of file eevee_shadows_cube.c.
References cubefacemat, DRW_view_create(), DRW_view_update(), float(), mul_m4_m4m4(), NULL, perspective_m4(), and view.
Referenced by EEVEE_shadows_draw_cubemap().
void EEVEE_shadows_cube_add | ( | EEVEE_LightsInfo * | linfo, |
EEVEE_Light * | evli, | ||
Object * | ob | ||
) |
Definition at line 10 of file eevee_shadows_cube.c.
References Object::base_flag, BASE_FROM_DUPLI, Light::bias, BLI_BITMAP_ENABLE, BoundSphere::center, Light::clipsta, copy_v3_v3(), EEVEE_LightsInfo::cube_len, Object::data, eevee_contact_shadow_setup(), EEVEE_light_data_ensure(), EEVEE_Light::invsqrdist, max_ff(), MAX_SHADOW_CUBE, EEVEE_LightEngineData::need_update, EEVEE_LightsInfo::num_cube_layer, EEVEE_LightsInfo::num_light, EEVEE_Light::position, BoundSphere::radius, EEVEE_LightsInfo::sh_cube_update, sh_data, EEVEE_LightsInfo::shadow_bounds, EEVEE_LightsInfo::shadow_cube_light_indices, EEVEE_LightsInfo::shadow_data, EEVEE_Light::shadow_id, EEVEE_LightsInfo::shadow_len, sqrt(), and update().
Referenced by EEVEE_lights_cache_add().
bool EEVEE_shadows_cube_setup | ( | EEVEE_LightsInfo * | linfo, |
const EEVEE_Light * | evli, | ||
int | sample_ofs | ||
) |
Return true if sample has changed and light needs to be updated.
Anti-Aliasing jitter: Add random rotation.
The 2.0 factor is because texel angular size is not even across the cube-map, so we make the rotation range a bit bigger. This will not blur the shadow even if the spread is too big since we are just rotating the shadow cube-map. Note that this may be a rough approximation an may not converge to a perfectly smooth shadow (because sample distribution is quite non-uniform) but is enough in practice.
Definition at line 83 of file eevee_shadows_cube.c.
References compare_v3v3(), copy_v3_v3(), DEG2RADF, e, eevee_light_matrix_get(), EEVEE_random_rotation_m4(), EEVEE_Shadow::far, float(), invert_m4(), EEVEE_Light::invsqrdist, max_ff(), min_ff(), EEVEE_Shadow::near, EEVEE_LightsInfo::shadow_cube_data, shadow_cube_random_position_set(), EEVEE_LightsInfo::shadow_cube_size, EEVEE_LightsInfo::shadow_data, EEVEE_Light::shadow_id, EEVEE_LightsInfo::soft_shadows, sqrt(), EEVEE_Shadow::type_data_id, and update().
Referenced by EEVEE_shadows_update().
void EEVEE_shadows_draw_cubemap | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata, | ||
int | cube_index | ||
) |
Definition at line 165 of file eevee_shadows_cube.c.
References BLI_BITMAP_SET, DRW_draw_pass(), DRW_view_set_active(), eevee_ensure_cube_views(), EEVEE_Shadow::far, EEVEE_StorageList::g_data, g_data, GPU_framebuffer_bind(), GPU_framebuffer_texture_layer_attach(), LA_LOCAL, LA_SPOT, EEVEE_LightsInfo::light_data, EEVEE_Light::light_type, EEVEE_ViewLayerData::lights, EEVEE_Shadow::near, EEVEE_Data::psl, EEVEE_LightsInfo::sh_cube_update, EEVEE_LightsInfo::shadow_cube_data, EEVEE_LightsInfo::shadow_cube_light_indices, EEVEE_ViewLayerData::shadow_cube_pool, EEVEE_LightsInfo::shadow_cube_size, EEVEE_LightsInfo::shadow_data, EEVEE_ViewLayerData::shadow_fb, EEVEE_Light::shadow_id, EEVEE_PassList::shadow_pass, spot_angle_fit_single_face(), EEVEE_Data::stl, and EEVEE_Shadow::type_data_id.
Referenced by EEVEE_shadows_draw().
|
static |
Definition at line 51 of file eevee_shadows_cube.c.
References add_v3_v3(), add_v3_v3v3(), DRW_debug_sphere(), EEVEE_sample_ball(), EEVEE_sample_ellipse(), EEVEE_sample_rectangle(), LA_AREA, LAMPTYPE_AREA_ELLIPSE, EEVEE_Light::light_type, EEVEE_Light::radius, EEVEE_Light::rightvec, EEVEE_Light::sizex, EEVEE_Light::sizey, and EEVEE_Light::upvec.
Referenced by EEVEE_shadows_cube_setup().
|
static |
Definition at line 153 of file eevee_shadows_cube.c.
References cosf, DEG2RADF, hypotf, max_ff(), min_ff(), EEVEE_Light::sizex, EEVEE_Light::sizey, EEVEE_Light::spotsize, and sqrtf.
Referenced by EEVEE_shadows_draw_cubemap().