Blender  V2.93
eevee_effects.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2016, Blender Foundation.
17  */
18 
25 #include "DRW_render.h"
26 
27 #include "BKE_global.h" /* for G.debug_value */
28 
29 #include "GPU_capabilities.h"
30 #include "GPU_platform.h"
31 #include "GPU_state.h"
32 #include "GPU_texture.h"
33 #include "eevee_private.h"
34 
35 static struct {
36  /* These are just references, not actually allocated */
39 
41  /* Size can be vec3. But we only use 2 components in the shader. */
42  float texel_size[2];
43 } e_data = {NULL}; /* Engine data */
44 
45 #define SETUP_BUFFER(tex, fb, fb_color) \
46  { \
47  eGPUTextureFormat format = (DRW_state_is_scene_render()) ? GPU_RGBA32F : GPU_RGBA16F; \
48  DRW_texture_ensure_fullscreen_2d(&tex, format, DRW_TEX_FILTER); \
49  GPU_framebuffer_ensure_config(&fb, \
50  { \
51  GPU_ATTACHMENT_TEXTURE(dtxl->depth), \
52  GPU_ATTACHMENT_TEXTURE(tex), \
53  }); \
54  GPU_framebuffer_ensure_config(&fb_color, \
55  { \
56  GPU_ATTACHMENT_NONE, \
57  GPU_ATTACHMENT_TEXTURE(tex), \
58  }); \
59  } \
60  ((void)0)
61 
62 #define CLEANUP_BUFFER(tex, fb, fb_color) \
63  { \
64  /* Cleanup to release memory */ \
65  DRW_TEXTURE_FREE_SAFE(tex); \
66  GPU_FRAMEBUFFER_FREE_SAFE(fb); \
67  GPU_FRAMEBUFFER_FREE_SAFE(fb_color); \
68  } \
69  ((void)0)
70 
72  EEVEE_Data *vedata,
73  Object *camera,
74  const bool minimal)
75 {
76  EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
77  EEVEE_StorageList *stl = vedata->stl;
78  EEVEE_FramebufferList *fbl = vedata->fbl;
79  EEVEE_TextureList *txl = vedata->txl;
80  EEVEE_EffectsInfo *effects;
82 
83  const float *viewport_size = DRW_viewport_size_get();
84  const int size_fs[2] = {(int)viewport_size[0], (int)viewport_size[1]};
85 
86  if (!stl->effects) {
87  stl->effects = MEM_callocN(sizeof(EEVEE_EffectsInfo), "EEVEE_EffectsInfo");
88  stl->effects->taa_render_sample = 1;
89  }
90 
91  /* WORKAROUND: EEVEE_lookdev_init can reset TAA and needs a stl->effect.
92  * So putting this before EEVEE_temporal_sampling_init for now. */
93  EEVEE_lookdev_init(vedata);
94 
95  effects = stl->effects;
96 
97  int div = 1 << MAX_SCREEN_BUFFERS_LOD_LEVEL;
98  effects->hiz_size[0] = divide_ceil_u(size_fs[0], div) * div;
99  effects->hiz_size[1] = divide_ceil_u(size_fs[1], div) * div;
100 
101  effects->enabled_effects = 0;
102  effects->enabled_effects |= (G.debug_value == 9) ? EFFECT_VELOCITY_BUFFER : 0;
103  effects->enabled_effects |= EEVEE_motion_blur_init(sldata, vedata);
104  effects->enabled_effects |= EEVEE_bloom_init(sldata, vedata);
105  effects->enabled_effects |= EEVEE_depth_of_field_init(sldata, vedata, camera);
106  effects->enabled_effects |= EEVEE_temporal_sampling_init(sldata, vedata);
107  effects->enabled_effects |= EEVEE_occlusion_init(sldata, vedata);
108  effects->enabled_effects |= EEVEE_screen_raytrace_init(sldata, vedata);
109 
110  /* Update matrices here because EEVEE_screen_raytrace_init can have reset the
111  * taa_current_sample. (See T66811) */
113 
114  EEVEE_volumes_init(sldata, vedata);
115  EEVEE_subsurface_init(sldata, vedata);
116 
117  /* Force normal buffer creation. */
118  if (!minimal && (stl->g_data->render_passes & EEVEE_RENDER_PASS_NORMAL) != 0) {
120  }
121 
127  /* Intel gpu seems to have problem rendering to only depth hiz_format */
129  GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
130  {
131  GPU_ATTACHMENT_NONE,
132  GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
133  });
134  }
135  else {
138  GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
139  {
140  GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
141  GPU_ATTACHMENT_NONE,
142  });
143  }
144 
145  if (fbl->downsample_fb == NULL) {
146  fbl->downsample_fb = GPU_framebuffer_create("downsample_fb");
147  }
148 
152  common_data->hiz_uv_scale[0] = viewport_size[0] / effects->hiz_size[0];
153  common_data->hiz_uv_scale[1] = viewport_size[1] / effects->hiz_size[1];
154 
155  /* Compute pixel size. Size is multiplied by 2 because it is applied in NDC [-1..1] range. */
156  sldata->common_data.ssr_pixelsize[0] = 2.0f / size_fs[0];
157  sldata->common_data.ssr_pixelsize[1] = 2.0f / size_fs[1];
158 
163  if ((effects->enabled_effects & EFFECT_RADIANCE_BUFFER) != 0) {
165  UNPACK2(effects->hiz_size),
168 
169  GPU_framebuffer_ensure_config(&fbl->radiance_filtered_fb,
170  {
171  GPU_ATTACHMENT_NONE,
172  GPU_ATTACHMENT_TEXTURE(txl->filtered_radiance),
173  });
174  }
175  else {
178  }
179 
183  if ((effects->enabled_effects & EFFECT_NORMAL_BUFFER) != 0) {
185  size_fs[0], size_fs[1], GPU_RG16, &draw_engine_eevee_type);
186 
188  }
189  else {
190  effects->ssr_normal_input = NULL;
191  }
192 
196  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
198  size_fs[0], size_fs[1], GPU_RGBA16, &draw_engine_eevee_type);
199 
200  GPU_framebuffer_ensure_config(&fbl->velocity_fb,
201  {
202  GPU_ATTACHMENT_TEXTURE(dtxl->depth),
203  GPU_ATTACHMENT_TEXTURE(effects->velocity_tx),
204  });
205 
206  GPU_framebuffer_ensure_config(
207  &fbl->velocity_resolve_fb,
208  {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->velocity_tx)});
209  }
210  else {
211  effects->velocity_tx = NULL;
212  }
213 
217  if ((effects->enabled_effects & EFFECT_DEPTH_DOUBLE_BUFFER) != 0) {
219 
220  GPU_framebuffer_ensure_config(&fbl->double_buffer_depth_fb,
221  {GPU_ATTACHMENT_TEXTURE(txl->depth_double_buffer)});
222  }
223  else {
224  /* Cleanup to release memory */
227  }
228 
229  if ((effects->enabled_effects & (EFFECT_TAA | EFFECT_TAA_REPROJECT)) != 0) {
231  }
232  else {
234  }
235 }
236 
238 {
239  EEVEE_PassList *psl = vedata->psl;
240  EEVEE_TextureList *txl = vedata->txl;
241  EEVEE_StorageList *stl = vedata->stl;
242  EEVEE_EffectsInfo *effects = stl->effects;
244  DRWShadingGroup *grp;
245 
246  /* Intel gpu seems to have problem rendering to only depth format.
247  * Use color texture instead. */
249  downsample_write = DRW_STATE_WRITE_COLOR;
250  }
251 
253 
254  if (effects->enabled_effects & EFFECT_RADIANCE_BUFFER) {
258  DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1);
260 
264  DRW_shgroup_uniform_vec2(grp, "texelSize", e_data.texel_size, 1);
266  }
267 
268  {
272  DRW_shgroup_uniform_texture_ref(grp, "source", &e_data.color_src);
273  DRW_shgroup_uniform_float(grp, "texelSize", e_data.texel_size, 1);
274  DRW_shgroup_uniform_int_copy(grp, "Layer", 0);
276  }
277 
278  {
279  /* Perform min/max down-sample. */
280  DRW_PASS_CREATE(psl->maxz_downlevel_ps, downsample_write);
283  DRW_shgroup_uniform_vec2(grp, "texelSize", e_data.texel_size, 1);
284  DRW_shgroup_call(grp, quad, NULL);
285 
286  /* Copy depth buffer to top level of HiZ */
287  DRW_PASS_CREATE(psl->maxz_copydepth_ps, downsample_write);
289  DRW_shgroup_uniform_texture_ref_ex(grp, "depthBuffer", &e_data.depth_src, GPU_SAMPLER_DEFAULT);
290  DRW_shgroup_call(grp, quad, NULL);
291 
292  DRW_PASS_CREATE(psl->maxz_copydepth_layer_ps, downsample_write);
295  DRW_shgroup_uniform_texture_ref_ex(grp, "depthBuffer", &e_data.depth_src, GPU_SAMPLER_DEFAULT);
296  DRW_shgroup_uniform_int(grp, "depthLayer", &e_data.depth_src_layer, 1);
297  DRW_shgroup_call(grp, quad, NULL);
298  }
299 
300  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
301  EEVEE_MotionBlurData *mb_data = &effects->motion_blur;
302 
303  /* This pass compute camera motions to the non moving objects. */
306  DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src);
307  DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo);
308  DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined);
309 
310  DRW_shgroup_uniform_mat4(grp, "prevViewProjMatrix", mb_data->camera[MB_PREV].persmat);
311  DRW_shgroup_uniform_mat4(grp, "currViewProjMatrixInv", mb_data->camera[MB_CURR].persinv);
312  DRW_shgroup_uniform_mat4(grp, "nextViewProjMatrix", mb_data->camera[MB_NEXT].persmat);
313  DRW_shgroup_call(grp, quad, NULL);
314  }
315 }
316 
318 {
319  EEVEE_FramebufferList *fbl = vedata->fbl;
320  EEVEE_TextureList *txl = vedata->txl;
321  EEVEE_EffectsInfo *effects = vedata->stl->effects;
326  if ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) {
328  }
329  else {
331  }
332 
336  if ((effects->enabled_effects & EFFECT_POST_BUFFER) != 0) {
338  }
339  else {
341  }
342 }
343 
344 #if 0 /* Not required for now */
345 static void min_downsample_cb(void *vedata, int UNUSED(level))
346 {
347  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
348  DRW_draw_pass(psl->minz_downlevel_ps);
349 }
350 #endif
351 
352 static void max_downsample_cb(void *vedata, int level)
353 {
354  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
355  EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl;
356  int texture_size[3];
357  GPU_texture_get_mipmap_size(txl->maxzbuffer, level - 1, texture_size);
358  e_data.texel_size[0] = 1.0f / texture_size[0];
359  e_data.texel_size[1] = 1.0f / texture_size[1];
361 }
362 
363 static void simple_downsample_cube_cb(void *vedata, int level)
364 {
365  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
366  e_data.texel_size[0] = (float)(1 << level) / (float)GPU_texture_width(e_data.color_src);
367  e_data.texel_size[1] = e_data.texel_size[0];
369 }
370 
372 {
373  EEVEE_PassList *psl = vedata->psl;
374  EEVEE_FramebufferList *fbl = vedata->fbl;
375 
376  e_data.depth_src = depth_src;
377  e_data.depth_src_layer = layer;
378 
379  DRW_stats_group_start("Max buffer");
380  /* Copy depth buffer to max texture top level */
382  if (layer >= 0) {
384  }
385  else {
387  }
388  /* Create lower levels */
392 
393  /* Restore */
395 
398  /* Fix dot corruption on intel HD5XX/HD6XX series. */
399  GPU_flush();
400  }
401 }
402 
403 static void downsample_radiance_cb(void *vedata, int level)
404 {
405  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
406  EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl;
407  int texture_size[3];
408  GPU_texture_get_mipmap_size(txl->filtered_radiance, level - 1, texture_size);
409  e_data.texel_size[0] = 1.0f / texture_size[0];
410  e_data.texel_size[1] = 1.0f / texture_size[1];
412 }
413 
418 {
419  EEVEE_PassList *psl = vedata->psl;
420  EEVEE_FramebufferList *fbl = vedata->fbl;
421 
422  e_data.color_src = texture_src;
423  DRW_stats_group_start("Downsample Radiance");
424 
427 
431 }
432 
436 void EEVEE_downsample_cube_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level)
437 {
438  EEVEE_FramebufferList *fbl = vedata->fbl;
439  e_data.color_src = texture_src;
440 
441  /* Create lower levels */
442  DRW_stats_group_start("Downsample Cube buffer");
443  GPU_framebuffer_texture_attach(fbl->downsample_fb, texture_src, 0, 0);
445  fbl->downsample_fb, level, &simple_downsample_cube_cb, vedata);
448 }
449 
450 static void EEVEE_velocity_resolve(EEVEE_Data *vedata)
451 {
452  EEVEE_PassList *psl = vedata->psl;
453  EEVEE_FramebufferList *fbl = vedata->fbl;
454  EEVEE_StorageList *stl = vedata->stl;
455  EEVEE_EffectsInfo *effects = stl->effects;
456 
457  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
459  e_data.depth_src = dtxl->depth;
460 
463 
464  if (psl->velocity_object) {
467  }
468  }
469 }
470 
472 {
473  EEVEE_TextureList *txl = vedata->txl;
474  EEVEE_FramebufferList *fbl = vedata->fbl;
475  EEVEE_StorageList *stl = vedata->stl;
476  EEVEE_EffectsInfo *effects = stl->effects;
477 
478  /* only once per frame after the first post process */
479  effects->swap_double_buffer = ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0);
480 
481  /* Init pointers */
482  effects->source_buffer = txl->color; /* latest updated texture */
483  effects->target_buffer = fbl->effect_color_fb; /* next target to render to */
484 
485  /* Post process stack (order matters) */
486  EEVEE_velocity_resolve(vedata);
487  EEVEE_motion_blur_draw(vedata);
489 
490  /* NOTE: Lookdev drawing happens before TAA but after
491  * motion blur and dof to avoid distortions.
492  * Velocity resolve use a hack to exclude lookdev
493  * spheres from creating shimmering re-projection vectors. */
494  EEVEE_lookdev_draw(vedata);
495 
497  EEVEE_bloom_draw(vedata);
498 
499  /* Post effect render passes are done here just after the drawing of the effects and just before
500  * the swapping of the buffers. */
501  EEVEE_renderpasses_output_accumulate(sldata, vedata, true);
502 
503  /* Save the final texture and framebuffer for final transformation or read. */
504  effects->final_tx = effects->source_buffer;
505  effects->final_fb = (effects->target_buffer != fbl->main_color_fb) ? fbl->main_fb :
506  fbl->effect_fb;
507  if ((effects->enabled_effects & EFFECT_TAA) && (effects->source_buffer == txl->taa_history)) {
508  effects->final_fb = fbl->taa_history_fb;
509  }
510 
511  /* If no post processes is enabled, buffers are still not swapped, do it now. */
513 
514  if (!stl->g_data->valid_double_buffer &&
515  ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) &&
516  (DRW_state_is_image_render() == false)) {
517  /* If history buffer is not valid request another frame.
518  * This fix black reflections on area resize. */
520  }
521 
522  /* Record perspective matrix for the next frame. */
523  DRW_view_persmat_get(effects->taa_view, effects->prev_persmat, false);
524 
525  /* Update double buffer status if render mode. */
528  stl->g_data->valid_taa_history = (txl->taa_history != NULL);
529  }
530 }
typedef float(TangentPoint)[2]
#define UNPACK2(a)
#define UNUSED(x)
@ EEVEE_RENDER_PASS_NORMAL
@ DRW_TEX_MIPMAP
Definition: DRW_render.h:142
@ DRW_TEX_FILTER
Definition: DRW_render.h:139
DRWState
Definition: DRW_render.h:312
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:314
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:315
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:321
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:593
#define DRW_shgroup_call(shgroup, geom, ob)
Definition: DRW_render.h:420
#define DRW_TEXTURE_FREE_SAFE(tex)
Definition: DRW_render.h:180
GPUBatch
Definition: GPU_batch.h:93
bool GPU_mip_render_workaround(void)
#define GPU_FRAMEBUFFER_FREE_SAFE(fb)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex)
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
@ GPU_DRIVER_ANY
Definition: GPU_platform.h:56
@ GPU_OS_WIN
Definition: GPU_platform.h:46
@ GPU_OS_ANY
Definition: GPU_platform.h:49
@ GPU_DEVICE_INTEL_UHD
Definition: GPU_platform.h:36
@ GPU_DEVICE_INTEL
Definition: GPU_platform.h:35
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
void GPU_flush(void)
Definition: gpu_state.cc:311
@ GPU_SAMPLER_FILTER
Definition: GPU_texture.h:42
@ GPU_SAMPLER_DEFAULT
Definition: GPU_texture.h:41
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
int GPU_texture_width(const GPUTexture *tex)
Definition: gpu_texture.cc:527
void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size)
Definition: gpu_texture.cc:590
@ GPU_R32F
Definition: GPU_texture.h:111
@ GPU_DEPTH24_STENCIL8
Definition: GPU_texture.h:121
@ GPU_RG16
Definition: GPU_texture.h:105
@ GPU_RGBA16
Definition: GPU_texture.h:95
@ GPU_DEPTH_COMPONENT24
Definition: GPU_texture.h:167
@ GPU_R11F_G11F_B10F
Definition: GPU_texture.h:119
GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition: draw_cache.c:358
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:439
bool DRW_state_is_image_render(void)
void DRW_viewport_request_redraw(void)
Definition: draw_manager.c:707
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:702
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, Object *ob, struct GPUBatch *geom, uint count)
void DRW_shgroup_uniform_texture_ref_ex(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex, eGPUSamplerState sampler_state)
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup, Object *ob, uint tri_count)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex, eGPUSamplerState sampler_state)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_shgroup_uniform_int(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float(*value)[4])
void DRW_shgroup_uniform_float(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
void DRW_shgroup_uniform_vec2(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
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)
void DRW_texture_ensure_2d(GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags)
GPUTexture * DRW_texture_pool_query_2d(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type)
void EEVEE_bloom_draw(EEVEE_Data *vedata)
Definition: eevee_bloom.c:243
int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
Definition: eevee_bloom.c:35
void EEVEE_depth_of_field_draw(EEVEE_Data *vedata)
int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata, Object *camera)
static void simple_downsample_cube_cb(void *vedata, int level)
float texel_size[2]
Definition: eevee_effects.c:42
#define SETUP_BUFFER(tex, fb, fb_color)
Definition: eevee_effects.c:45
#define CLEANUP_BUFFER(tex, fb, fb_color)
Definition: eevee_effects.c:62
void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int layer)
void EEVEE_effects_downsample_radiance_buffer(EEVEE_Data *vedata, GPUTexture *texture_src)
void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
static void max_downsample_cb(void *vedata, int level)
struct GPUTexture * color_src
Definition: eevee_effects.c:38
void EEVEE_draw_effects(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Object *camera, const bool minimal)
Definition: eevee_effects.c:71
static struct @192 e_data
void EEVEE_downsample_cube_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level)
static void EEVEE_velocity_resolve(EEVEE_Data *vedata)
int depth_src_layer
Definition: eevee_effects.c:40
static void downsample_radiance_cb(void *vedata, int level)
void EEVEE_effects_draw_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
struct GPUTexture * depth_src
Definition: eevee_effects.c:37
DrawEngineType draw_engine_eevee_type
Definition: eevee_engine.c:622
void EEVEE_lookdev_init(EEVEE_Data *vedata)
Definition: eevee_lookdev.c:99
void EEVEE_lookdev_draw(EEVEE_Data *vedata)
void EEVEE_motion_blur_draw(EEVEE_Data *vedata)
int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
struct GPUShader * EEVEE_shaders_effect_color_copy_sh_get(void)
void EEVEE_renderpasses_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, bool post_effect)
struct GPUShader * EEVEE_shaders_effect_maxz_downlevel_sh_get(void)
#define MAX_SCREEN_BUFFERS_LOD_LEVEL
struct GPUShader * EEVEE_shaders_velocity_resolve_sh_get(void)
struct GPUShader * EEVEE_shaders_effect_maxz_copydepth_sh_get(void)
int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
struct GPUShader * EEVEE_shaders_effect_downsample_cube_sh_get(void)
#define SWAP_DOUBLE_BUFFERS()
Definition: eevee_private.h:92
struct GPUShader * EEVEE_shaders_effect_downsample_sh_get(void)
void EEVEE_subsurface_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_temporal_sampling_draw(EEVEE_Data *vedata)
#define MB_PREV
struct GPUShader * EEVEE_shaders_effect_maxz_copydepth_layer_sh_get(void)
@ EFFECT_TAA_REPROJECT
@ EFFECT_RADIANCE_BUFFER
@ EFFECT_DOUBLE_BUFFER
@ EFFECT_VELOCITY_BUFFER
@ EFFECT_DEPTH_DOUBLE_BUFFER
@ EFFECT_POST_BUFFER
@ EFFECT_NORMAL_BUFFER
@ EFFECT_TAA
#define MB_NEXT
int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_temporal_sampling_update_matrices(EEVEE_Data *vedata)
#define MB_CURR
GPUBatch * quad
void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *gpu_fb, int max_lvl, void(*callback)(void *userData, int level), void *userData)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
MINLINE uint divide_ceil_u(uint a, uint b)
struct GPUTexture * depth
EEVEE_TextureList * txl
EEVEE_StorageList * stl
EEVEE_PassList * psl
EEVEE_FramebufferList * fbl
struct GPUTexture * source_buffer
struct GPUTexture * final_tx
struct GPUFrameBuffer * target_buffer
EEVEE_EffectsFlag enabled_effects
struct GPUTexture * velocity_tx
float prev_persmat[4][4]
struct GPUFrameBuffer * final_fb
struct GPUTexture * ssr_normal_input
struct DRWView * taa_view
struct EEVEE_MotionBlurData motion_blur
struct GPUFrameBuffer * main_fb
struct GPUFrameBuffer * taa_history_color_fb
struct GPUFrameBuffer * radiance_filtered_fb
struct GPUFrameBuffer * double_buffer_color_fb
struct GPUFrameBuffer * velocity_resolve_fb
struct GPUFrameBuffer * double_buffer_depth_fb
struct GPUFrameBuffer * downsample_fb
struct GPUFrameBuffer * taa_history_fb
struct GPUFrameBuffer * main_color_fb
struct GPUFrameBuffer * double_buffer_fb
struct GPUFrameBuffer * effect_fb
struct GPUFrameBuffer * velocity_fb
struct GPUFrameBuffer * maxzbuffer_fb
struct GPUFrameBuffer * effect_color_fb
struct EEVEE_MotionBlurData::@200 camera[3]
struct DRWPass * velocity_object
struct DRWPass * maxz_copydepth_ps
struct DRWPass * maxz_copydepth_layer_ps
struct DRWPass * velocity_resolve
struct DRWPass * maxz_downlevel_ps
struct DRWPass * color_copy_ps
struct DRWPass * color_downsample_cube_ps
struct DRWPass * color_downsample_ps
eViewLayerEEVEEPassType render_passes
struct EEVEE_PrivateData * g_data
struct EEVEE_EffectsInfo * effects
struct GPUTexture * filtered_radiance
struct GPUTexture * depth_double_buffer
struct GPUTexture * color_double_buffer
struct GPUTexture * maxzbuffer
struct GPUTexture * color_post
struct GPUTexture * taa_history
struct GPUTexture * color
struct EEVEE_CommonUniformBuffer common_data
struct GPUUniformBuf * combined
struct EEVEE_ViewLayerData::@202 renderpass_ubo
struct GPUUniformBuf * common_ubo
#define G(x, y, z)