Blender  V3.3
Functions
eevee_shadows_cube.c File Reference
#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)
 

Function Documentation

◆ eevee_ensure_cube_views()

static void eevee_ensure_cube_views ( float  near,
float  far,
int  cube_res,
const float  viewmat[4][4],
DRWView view[6] 
)
static

◆ EEVEE_shadows_cube_add()

void EEVEE_shadows_cube_add ( EEVEE_LightsInfo linfo,
EEVEE_Light evli,
Object ob 
)

◆ EEVEE_shadows_cube_setup()

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().

◆ EEVEE_shadows_draw_cubemap()

void EEVEE_shadows_draw_cubemap ( EEVEE_ViewLayerData sldata,
EEVEE_Data vedata,
int  cube_index 
)

◆ shadow_cube_random_position_set()

static void shadow_cube_random_position_set ( const EEVEE_Light evli,
int  sample_ofs,
float  ws_sample_pos[3] 
)
static

◆ spot_angle_fit_single_face()

static bool spot_angle_fit_single_face ( const EEVEE_Light evli)
static