53 float ws_sample_pos[3])
56 #ifdef DEBUG_SHADOW_DISTRIBUTION
72 #ifdef DEBUG_SHADOW_DISTRIBUTION
75 DRW_debug_sphere(p, 0.01f, (
float[4]){1.0f, (sample_ofs == i) ? 1.0f : 0.0f, 0.0f, 1.0f});
76 if (i++ < sample_ofs) {
117 copy_v3_v3(cube_data->position, cube_data->shadowmat[3]);
124 float near,
float far,
int cube_res,
const float viewmat[4][4],
DRWView *
view[6])
134 side *= ((
float)cube_res + 1.0f) / (
float)(cube_res);
139 for (
int i = 0; i < 6; i++) {
158 float sin_alpha =
sqrtf(
max_ff(0.0f, 1.0f - cos_alpha * cos_alpha));
160 cos_alpha /
hypotf(cos_alpha, sin_alpha * evli->
sizey));
179 cube_data->shadowmat,
186 for (
int j = 0; j < 6; j++) {
201 int layer = cube_index * 6 + j;
204 GPU_framebuffer_clear_depth(sldata->
shadow_fb, 1.0f);
typedef float(TangentPoint)[2]
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_SET(_bitmap, _index, _set)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void perspective_m4(float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4(float R[4][4])
MINLINE bool compare_v3v3(const float a[3], const float b[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
BASIC_Shaders sh_data[GPU_SHADER_CFG_LEN]
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void DRW_debug_sphere(const float center[3], const float radius, const float color[4])
DRWView * DRW_view_create(const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4], DRWCallVisibilityFn *visibility_fn)
void DRW_view_update(DRWView *view, const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4])
void DRW_draw_pass(DRWPass *pass)
void DRW_view_set_active(const DRWView *view)
static struct @318 g_data
EEVEE_LightEngineData * EEVEE_light_data_ensure(Object *ob)
void eevee_light_matrix_get(const EEVEE_Light *evli, float r_mat[4][4])
void EEVEE_sample_ellipse(int sample_ofs, const float x_axis[3], const float y_axis[3], float size_x, float size_y, float rsample[3])
#define LAMPTYPE_AREA_ELLIPSE
void EEVEE_random_rotation_m4(int sample_ofs, float scale, float r_mat[4][4])
void EEVEE_sample_ball(int sample_ofs, float radius, float rsample[3])
static const float cubefacemat[6][4][4]
void EEVEE_sample_rectangle(int sample_ofs, const float x_axis[3], const float y_axis[3], float size_x, float size_y, float rsample[3])
void eevee_contact_shadow_setup(const Light *la, EEVEE_Shadow *evsh)
static void eevee_ensure_cube_views(float near, float far, int cube_res, const float viewmat[4][4], DRWView *view[6])
bool EEVEE_shadows_cube_setup(EEVEE_LightsInfo *linfo, const EEVEE_Light *evli, int sample_ofs)
void EEVEE_shadows_cube_add(EEVEE_LightsInfo *linfo, EEVEE_Light *evli, Object *ob)
static bool spot_angle_fit_single_face(const EEVEE_Light *evli)
static void shadow_cube_random_position_set(const EEVEE_Light *evli, int sample_ofs, float ws_sample_pos[3])
void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, int cube_index)
void GPU_framebuffer_texture_layer_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int layer, int mip)
static void update(bNodeTree *ntree)
struct EEVEE_Light light_data[MAX_LIGHT]
struct EEVEE_Shadow shadow_data[MAX_SHADOW]
struct EEVEE_ShadowCube shadow_cube_data[MAX_SHADOW_CUBE]
struct BoundSphere shadow_bounds[MAX_LIGHT]
BLI_bitmap sh_cube_update[BLI_BITMAP_SIZE(MAX_SHADOW_CUBE)]
uchar shadow_cube_light_indices[MAX_SHADOW_CUBE]
struct DRWPass * shadow_pass
struct EEVEE_PrivateData * g_data
struct GPUTexture * shadow_cube_pool
struct GPUFrameBuffer * shadow_fb
struct EEVEE_LightsInfo * lights