32 #define SH_CASTER_ALLOC_CHUNK 32
55 for (
int i = 0; i < 2; i++) {
79 BLI_assert((sh_cube_size > 0) && (sh_cube_size <= 4096));
81 CLAMP(sh_cube_size, 1, 4096);
86 BLI_assert((sh_cascade_size > 0) && (sh_cascade_size <= 4096));
88 CLAMP(sh_cascade_size, 1, 4096);
105 frontbuffer->count = 0;
133 int id = frontbuffer->count;
136 if (
id >= frontbuffer->alloc_count) {
138 frontbuffer->alloc_count *= 2;
154 if (past_id > -1 && past_id < backbuffer->
count) {
169 for (
int i = 0; i < 8; i++) {
189 frontbuffer->count++;
251 for (
int j = 0; j < linfo->
cube_len; j++) {
263 for (
int i = 0; i < backbuffer->count; i++) {
266 for (
int j = 0; j < linfo->
cube_len; j++) {
276 bbox = frontbuffer->bbox;
277 for (
int i = 0; i < frontbuffer->count; i++) {
280 for (
int j = 0; j < linfo->
cube_len; j++) {
337 for (
int cascade = 0; cascade < linfo->
cascade_len; cascade++) {
371 {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->shadow_accum)});
404 const float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f};
General operations, lookup, etc. for blender objects.
struct BoundBox * BKE_object_boundbox_get(struct Object *ob)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_NEW_ALLOCA(_tot)
#define BLI_BITMAP_NEW(_tot, _alloc_string)
void BLI_bitmap_set_all(BLI_bitmap *bitmap, bool set, size_t bits)
#define BLI_BITMAP_SET(_bitmap, _index, _set)
#define BLI_BITMAP_RESIZE(_bitmap, _tot)
MINLINE int max_ii(int a, int b)
void mul_m4_v3(const float M[4][4], float r[3])
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
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])
#define INIT_MINMAX(min, max)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ SCE_EEVEE_SHADOW_HIGH_BITDEPTH
@ DRW_STATE_SHADOW_OFFSET
@ DRW_STATE_BLEND_ADD_FULL
@ DRW_STATE_DEPTH_LESS_EQUAL
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_call(shgroup, geom, ob)
#define DRW_TEXTURE_FREE_SAFE(tex)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define MEM_reallocN(vmemh, len)
Group RGB to Bright Vector Camera CLAMP
GPUBatch * DRW_cache_fullscreen_quad_get(void)
const DRWContextState * DRW_context_state_get(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
void DRW_view_set_active(DRWView *view)
bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere)
void DRW_draw_pass(DRWPass *pass)
void DRW_stats_group_start(const char *name)
void DRW_stats_group_end(void)
void DRW_texture_ensure_fullscreen_2d(GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags)
GPUTexture * DRW_texture_create_2d_array(int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
EEVEE_ObjectEngineData * EEVEE_object_data_ensure(Object *ob)
struct GPUTexture * EEVEE_materials_get_util_tex(void)
struct EEVEE_Shadow EEVEE_Shadow
#define MAX_SHADOW_CASCADE
struct GPUShader * EEVEE_shaders_shadow_accum_sh_get(void)
struct EEVEE_ShadowCascade EEVEE_ShadowCascade
bool EEVEE_shadows_cube_setup(EEVEE_LightsInfo *linfo, const EEVEE_Light *evli, int sample_ofs)
void EEVEE_shadows_draw_cascades(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWView *view, int cascade_index)
struct GPUShader * EEVEE_shaders_shadow_sh_get(void)
void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, int cube_index)
void EEVEE_shadows_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_shadows_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_shadow_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, uint UNUSED(tot_samples))
#define SH_CASTER_ALLOC_CHUNK
void EEVEE_shadows_caster_register(EEVEE_ViewLayerData *sldata, Object *ob)
void EEVEE_shadow_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
void EEVEE_shadows_init(EEVEE_ViewLayerData *sldata)
void EEVEE_shadows_draw(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWView *view)
static bool sphere_bbox_intersect(const BoundSphere *bs, const EEVEE_BoundBox *bb)
void eevee_contact_shadow_setup(const Light *la, EEVEE_Shadow *evsh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void clear(Message *msg)
static void update(bNodeTree *ntree)
struct GPUTexture * depth
EEVEE_FramebufferList * fbl
struct GPUFrameBuffer * main_fb
struct GPUFrameBuffer * shadow_accum_fb
struct EEVEE_Light light_data[MAX_LIGHT]
struct EEVEE_ShadowCasterBuffer * shcaster_frontbuffer
int cache_num_cascade_layer
struct EEVEE_Shadow shadow_data[MAX_SHADOW]
struct BoundSphere shadow_bounds[MAX_LIGHT]
bool shadow_high_bitdepth
BLI_bitmap sh_cube_update[BLI_BITMAP_SIZE(MAX_SHADOW_CUBE)]
uchar shadow_cube_light_indices[MAX_SHADOW_CUBE]
struct EEVEE_ShadowCasterBuffer * shcaster_backbuffer
struct EEVEE_LightsInfo::@199 shcaster_aabb
struct DRWPass * shadow_accum_pass
struct DRWPass * shadow_pass
struct DRWShadingGroup * shadow_shgrp
struct EEVEE_PrivateData * g_data
struct EEVEE_EffectsInfo * effects
struct GPUTexture * shadow_accum
struct EEVEE_CommonUniformBuffer common_data
struct GPUTexture * shadow_cube_pool
struct GPUUniformBuf * combined
struct GPUUniformBuf * shadow_ubo
struct GPUUniformBuf * probe_ubo
struct GPUUniformBuf * grid_ubo
struct GPUFrameBuffer * shadow_fb
struct GPUUniformBuf * planar_ubo
struct EEVEE_ViewLayerData::@202 renderpass_ubo
struct GPUUniformBuf * common_ubo
struct GPUUniformBuf * light_ubo
struct GPUTexture * shadow_cascade_pool
struct EEVEE_ShadowCasterBuffer shcasters_buffers[2]
struct EEVEE_LightsInfo * lights