Blender  V3.3
eevee_effects.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. */
3 
10 #include "DRW_render.h"
11 
12 #include "BKE_global.h" /* for G.debug_value */
13 
14 #include "GPU_capabilities.h"
15 #include "GPU_platform.h"
16 #include "GPU_state.h"
17 #include "GPU_texture.h"
18 #include "eevee_private.h"
19 
20 static struct {
21  /* These are just references, not actually allocated */
24 
26  /* Size can be vec3. But we only use 2 components in the shader. */
27  float texel_size[2];
28 } e_data = {NULL}; /* Engine data */
29 
30 #define SETUP_BUFFER(tex, fb, fb_color) \
31  { \
32  eGPUTextureFormat format = (DRW_state_is_scene_render()) ? GPU_RGBA32F : GPU_RGBA16F; \
33  DRW_texture_ensure_fullscreen_2d(&tex, format, DRW_TEX_FILTER); \
34  GPU_framebuffer_ensure_config(&fb, \
35  { \
36  GPU_ATTACHMENT_TEXTURE(dtxl->depth), \
37  GPU_ATTACHMENT_TEXTURE(tex), \
38  }); \
39  GPU_framebuffer_ensure_config(&fb_color, \
40  { \
41  GPU_ATTACHMENT_NONE, \
42  GPU_ATTACHMENT_TEXTURE(tex), \
43  }); \
44  } \
45  ((void)0)
46 
47 #define CLEANUP_BUFFER(tex, fb, fb_color) \
48  { \
49  /* Cleanup to release memory */ \
50  DRW_TEXTURE_FREE_SAFE(tex); \
51  GPU_FRAMEBUFFER_FREE_SAFE(fb); \
52  GPU_FRAMEBUFFER_FREE_SAFE(fb_color); \
53  } \
54  ((void)0)
55 
57  EEVEE_Data *vedata,
58  Object *camera,
59  const bool minimal)
60 {
61  EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
62  EEVEE_StorageList *stl = vedata->stl;
63  EEVEE_FramebufferList *fbl = vedata->fbl;
64  EEVEE_TextureList *txl = vedata->txl;
65  EEVEE_EffectsInfo *effects;
67 
68  const float *viewport_size = DRW_viewport_size_get();
69  const int size_fs[2] = {(int)viewport_size[0], (int)viewport_size[1]};
70 
71  if (!stl->effects) {
72  stl->effects = MEM_callocN(sizeof(EEVEE_EffectsInfo), "EEVEE_EffectsInfo");
73  stl->effects->taa_render_sample = 1;
74  }
75 
76  /* WORKAROUND: EEVEE_lookdev_init can reset TAA and needs a stl->effect.
77  * So putting this before EEVEE_temporal_sampling_init for now. */
78  EEVEE_lookdev_init(vedata);
79 
80  effects = stl->effects;
81 
82  int div = 1 << MAX_SCREEN_BUFFERS_LOD_LEVEL;
83  effects->hiz_size[0] = divide_ceil_u(size_fs[0], div) * div;
84  effects->hiz_size[1] = divide_ceil_u(size_fs[1], div) * div;
85 
86  effects->enabled_effects = 0;
87  effects->enabled_effects |= (G.debug_value == 9) ? EFFECT_VELOCITY_BUFFER : 0;
88  effects->enabled_effects |= EEVEE_motion_blur_init(sldata, vedata);
89  effects->enabled_effects |= EEVEE_bloom_init(sldata, vedata);
90  effects->enabled_effects |= EEVEE_depth_of_field_init(sldata, vedata, camera);
91  effects->enabled_effects |= EEVEE_temporal_sampling_init(sldata, vedata);
92  effects->enabled_effects |= EEVEE_occlusion_init(sldata, vedata);
93  effects->enabled_effects |= EEVEE_screen_raytrace_init(sldata, vedata);
94 
95  /* Update matrices here because EEVEE_screen_raytrace_init can have reset the
96  * taa_current_sample. (See T66811) */
98 
99  EEVEE_volumes_init(sldata, vedata);
100  EEVEE_subsurface_init(sldata, vedata);
101 
102  /* Force normal buffer creation. */
103  if (!minimal && (stl->g_data->render_passes & EEVEE_RENDER_PASS_NORMAL) != 0) {
105  }
106 
112  /* Intel gpu seems to have problem rendering to only depth hiz_format */
114  GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
115  {
116  GPU_ATTACHMENT_NONE,
117  GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
118  });
119  }
120  else {
123  GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
124  {
125  GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
126  GPU_ATTACHMENT_NONE,
127  });
128  }
129 
130  if (fbl->downsample_fb == NULL) {
131  fbl->downsample_fb = GPU_framebuffer_create("downsample_fb");
132  }
133 
137  common_data->hiz_uv_scale[0] = viewport_size[0] / effects->hiz_size[0];
138  common_data->hiz_uv_scale[1] = viewport_size[1] / effects->hiz_size[1];
139 
140  /* Compute pixel size. Size is multiplied by 2 because it is applied in NDC [-1..1] range. */
141  sldata->common_data.ssr_pixelsize[0] = 2.0f / size_fs[0];
142  sldata->common_data.ssr_pixelsize[1] = 2.0f / size_fs[1];
143 
148  if ((effects->enabled_effects & EFFECT_RADIANCE_BUFFER) != 0) {
150  UNPACK2(effects->hiz_size),
153 
154  GPU_framebuffer_ensure_config(&fbl->radiance_filtered_fb,
155  {
156  GPU_ATTACHMENT_NONE,
157  GPU_ATTACHMENT_TEXTURE(txl->filtered_radiance),
158  });
159  }
160  else {
162  GPU_FRAMEBUFFER_FREE_SAFE(fbl->radiance_filtered_fb);
163  }
164 
168  if ((effects->enabled_effects & EFFECT_NORMAL_BUFFER) != 0) {
170  size_fs[0], size_fs[1], GPU_RG16, &draw_engine_eevee_type);
171 
173  }
174  else {
175  effects->ssr_normal_input = NULL;
176  }
177 
181  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
183  size_fs[0], size_fs[1], GPU_RGBA16, &draw_engine_eevee_type);
184 
185  GPU_framebuffer_ensure_config(&fbl->velocity_fb,
186  {
187  GPU_ATTACHMENT_TEXTURE(dtxl->depth),
188  GPU_ATTACHMENT_TEXTURE(effects->velocity_tx),
189  });
190 
191  GPU_framebuffer_ensure_config(
192  &fbl->velocity_resolve_fb,
193  {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->velocity_tx)});
194  }
195  else {
196  effects->velocity_tx = NULL;
197  }
198 
202  if ((effects->enabled_effects & EFFECT_DEPTH_DOUBLE_BUFFER) != 0) {
204 
205  GPU_framebuffer_ensure_config(&fbl->double_buffer_depth_fb,
206  {GPU_ATTACHMENT_TEXTURE(txl->depth_double_buffer)});
207  }
208  else {
209  /* Cleanup to release memory */
211  GPU_FRAMEBUFFER_FREE_SAFE(fbl->double_buffer_depth_fb);
212  }
213 
214  if ((effects->enabled_effects & (EFFECT_TAA | EFFECT_TAA_REPROJECT)) != 0) {
216  }
217  else {
219  }
220 }
221 
223 {
224  EEVEE_PassList *psl = vedata->psl;
225  EEVEE_TextureList *txl = vedata->txl;
226  EEVEE_StorageList *stl = vedata->stl;
227  EEVEE_EffectsInfo *effects = stl->effects;
229  DRWShadingGroup *grp;
230 
231  /* Intel gpu seems to have problem rendering to only depth format.
232  * Use color texture instead. */
234  downsample_write = DRW_STATE_WRITE_COLOR;
235  }
236 
238 
239  if (effects->enabled_effects & EFFECT_RADIANCE_BUFFER) {
243  DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1);
245 
249  DRW_shgroup_uniform_vec2(grp, "texelSize", e_data.texel_size, 1);
251  }
252 
253  {
257  DRW_shgroup_uniform_texture_ref(grp, "source", &e_data.color_src);
258  DRW_shgroup_uniform_float(grp, "texelSize", e_data.texel_size, 1);
259  DRW_shgroup_uniform_int_copy(grp, "Layer", 0);
261  }
262 
263  {
264  /* Perform min/max down-sample. */
265  DRW_PASS_CREATE(psl->maxz_downlevel_ps, downsample_write);
268  DRW_shgroup_uniform_vec2(grp, "texelSize", e_data.texel_size, 1);
269  DRW_shgroup_call(grp, quad, NULL);
270 
271  /* Copy depth buffer to top level of HiZ */
272  DRW_PASS_CREATE(psl->maxz_copydepth_ps, downsample_write);
274  DRW_shgroup_uniform_texture_ref_ex(grp, "depthBuffer", &e_data.depth_src, GPU_SAMPLER_DEFAULT);
275  DRW_shgroup_call(grp, quad, NULL);
276 
277  DRW_PASS_CREATE(psl->maxz_copydepth_layer_ps, downsample_write);
280  DRW_shgroup_uniform_texture_ref_ex(grp, "depthBuffer", &e_data.depth_src, GPU_SAMPLER_DEFAULT);
281  DRW_shgroup_uniform_int(grp, "depthLayer", &e_data.depth_src_layer, 1);
282  DRW_shgroup_call(grp, quad, NULL);
283  }
284 
285  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
286  EEVEE_MotionBlurData *mb_data = &effects->motion_blur;
287 
288  /* This pass compute camera motions to the non moving objects. */
291  DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src);
292  DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo);
293  DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined);
294 
295  DRW_shgroup_uniform_mat4(grp, "prevViewProjMatrix", mb_data->camera[MB_PREV].persmat);
296  DRW_shgroup_uniform_mat4(grp, "currViewProjMatrixInv", mb_data->camera[MB_CURR].persinv);
297  DRW_shgroup_uniform_mat4(grp, "nextViewProjMatrix", mb_data->camera[MB_NEXT].persmat);
298  DRW_shgroup_call(grp, quad, NULL);
299  }
300 }
301 
303 {
304  EEVEE_FramebufferList *fbl = vedata->fbl;
305  EEVEE_TextureList *txl = vedata->txl;
306  EEVEE_EffectsInfo *effects = vedata->stl->effects;
311  if ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) {
313  }
314  else {
316  }
317 
321  if ((effects->enabled_effects & EFFECT_POST_BUFFER) != 0) {
323  }
324  else {
326  }
327 }
328 
329 #if 0 /* Not required for now */
330 static void min_downsample_cb(void *vedata, int UNUSED(level))
331 {
332  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
333  DRW_draw_pass(psl->minz_downlevel_ps);
334 }
335 #endif
336 
337 static void max_downsample_cb(void *vedata, int level)
338 {
339  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
340  EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl;
341  int texture_size[3];
342  GPU_texture_get_mipmap_size(txl->maxzbuffer, level - 1, texture_size);
343  e_data.texel_size[0] = 1.0f / texture_size[0];
344  e_data.texel_size[1] = 1.0f / texture_size[1];
346 }
347 
348 static void simple_downsample_cube_cb(void *vedata, int level)
349 {
350  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
351  e_data.texel_size[0] = (float)(1 << level) / (float)GPU_texture_width(e_data.color_src);
352  e_data.texel_size[1] = e_data.texel_size[0];
354 }
355 
357 {
358  EEVEE_PassList *psl = vedata->psl;
359  EEVEE_FramebufferList *fbl = vedata->fbl;
360 
361  e_data.depth_src = depth_src;
362  e_data.depth_src_layer = layer;
363 
364  DRW_stats_group_start("Max buffer");
365  /* Copy depth buffer to max texture top level */
367  if (layer >= 0) {
369  }
370  else {
372  }
373  /* Create lower levels */
377 
378  /* Restore */
380 
383  /* Fix dot corruption on intel HD5XX/HD6XX series. */
384  GPU_flush();
385  }
386 }
387 
388 static void downsample_radiance_cb(void *vedata, int level)
389 {
390  EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
391  EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl;
392  int texture_size[3];
393  GPU_texture_get_mipmap_size(txl->filtered_radiance, level - 1, texture_size);
394  e_data.texel_size[0] = 1.0f / texture_size[0];
395  e_data.texel_size[1] = 1.0f / texture_size[1];
397 }
398 
400 {
401  EEVEE_PassList *psl = vedata->psl;
402  EEVEE_FramebufferList *fbl = vedata->fbl;
403 
404  e_data.color_src = texture_src;
405  DRW_stats_group_start("Downsample Radiance");
406 
409 
413 }
414 
415 void EEVEE_downsample_cube_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level)
416 {
417  EEVEE_FramebufferList *fbl = vedata->fbl;
418  e_data.color_src = texture_src;
419 
420  /* Create lower levels */
421  DRW_stats_group_start("Downsample Cube buffer");
422  GPU_framebuffer_texture_attach(fbl->downsample_fb, texture_src, 0, 0);
424  fbl->downsample_fb, level, &simple_downsample_cube_cb, vedata);
427 }
428 
429 static void EEVEE_velocity_resolve(EEVEE_Data *vedata)
430 {
431  EEVEE_PassList *psl = vedata->psl;
432  EEVEE_FramebufferList *fbl = vedata->fbl;
433  EEVEE_StorageList *stl = vedata->stl;
434  EEVEE_EffectsInfo *effects = stl->effects;
435 
436  if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
438  e_data.depth_src = dtxl->depth;
439 
442 
443  if (psl->velocity_object) {
446  }
447  }
448 }
449 
451 {
452  EEVEE_TextureList *txl = vedata->txl;
453  EEVEE_FramebufferList *fbl = vedata->fbl;
454  EEVEE_StorageList *stl = vedata->stl;
455  EEVEE_EffectsInfo *effects = stl->effects;
456 
457  /* only once per frame after the first post process */
458  effects->swap_double_buffer = ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0);
459 
460  /* Init pointers */
461  effects->source_buffer = txl->color; /* latest updated texture */
462  effects->target_buffer = fbl->effect_color_fb; /* next target to render to */
463 
464  /* Post process stack (order matters) */
465  EEVEE_velocity_resolve(vedata);
466  EEVEE_motion_blur_draw(vedata);
468 
469  /* NOTE: Lookdev drawing happens before TAA but after
470  * motion blur and DOF to avoid distortions.
471  * Velocity resolve use a hack to exclude lookdev
472  * spheres from creating shimmering re-projection vectors. */
473  EEVEE_lookdev_draw(vedata);
474 
476  EEVEE_bloom_draw(vedata);
477 
478  /* Post effect render passes are done here just after the drawing of the effects and just before
479  * the swapping of the buffers. */
480  EEVEE_renderpasses_output_accumulate(sldata, vedata, true);
481 
482  /* Save the final texture and frame-buffer for final transformation or read. */
483  effects->final_tx = effects->source_buffer;
484  effects->final_fb = (effects->target_buffer != fbl->main_color_fb) ? fbl->main_fb :
485  fbl->effect_fb;
486  if ((effects->enabled_effects & EFFECT_TAA) && (effects->source_buffer == txl->taa_history)) {
487  effects->final_fb = fbl->taa_history_fb;
488  }
489 
490  /* If no post processes is enabled, buffers are still not swapped, do it now. */
492 
493  if (!stl->g_data->valid_double_buffer &&
494  ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) &&
495  (DRW_state_is_image_render() == false)) {
496  /* If history buffer is not valid request another frame.
497  * This fix black reflections on area resize. */
499  }
500 
501  /* Record perspective matrix for the next frame. */
502  DRW_view_persmat_get(effects->taa_view, effects->prev_persmat, false);
503 
504  /* Update double buffer status if render mode. */
507  stl->g_data->valid_taa_history = (txl->taa_history != NULL);
508  }
509 }
typedef float(TangentPoint)[2]
MINLINE uint divide_ceil_u(uint a, uint b)
#define UNPACK2(a)
#define UNUSED(x)
@ EEVEE_RENDER_PASS_NORMAL
@ DRW_TEX_MIPMAP
Definition: DRW_render.h:143
@ DRW_TEX_FILTER
Definition: DRW_render.h:140
DRWState
Definition: DRW_render.h:298
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:302
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:303
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:309
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:690
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
Definition: DRW_render.h:651
#define DRW_shgroup_call(shgroup, geom, ob)
Definition: DRW_render.h:414
#define DRW_TEXTURE_FREE_SAFE(tex)
Definition: DRW_render.h:183
GPUBatch
Definition: GPU_batch.h:78
bool GPU_mip_render_workaround(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex)
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
@ GPU_BACKEND_OPENGL
Definition: GPU_platform.h:17
@ GPU_DRIVER_ANY
Definition: GPU_platform.h:47
bool GPU_type_matches_ex(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver, eGPUBackendType backend)
@ GPU_OS_WIN
Definition: GPU_platform.h:37
@ GPU_OS_ANY
Definition: GPU_platform.h:40
@ GPU_DEVICE_INTEL_UHD
Definition: GPU_platform.h:27
@ GPU_DEVICE_INTEL
Definition: GPU_platform.h:26
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
void GPU_flush(void)
Definition: gpu_state.cc:291
@ GPU_SAMPLER_FILTER
Definition: GPU_texture.h:27
@ GPU_SAMPLER_DEFAULT
Definition: GPU_texture.h:26
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
int GPU_texture_width(const GPUTexture *tex)
Definition: gpu_texture.cc:602
void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size)
Definition: gpu_texture.cc:688
@ GPU_DEPTH24_STENCIL8
Definition: GPU_texture.h:120
@ GPU_RG16
Definition: GPU_texture.h:104
@ GPU_RGBA16
Definition: GPU_texture.h:94
@ GPU_DEPTH_COMPONENT24
Definition: GPU_texture.h:166
@ GPU_R11F_G11F_B10F
Definition: GPU_texture.h:118
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition: draw_cache.c:356
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:288
bool DRW_state_is_image_render(void)
void DRW_viewport_request_redraw(void)
Definition: draw_manager.c:643
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:638
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:234
int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
Definition: eevee_bloom.c:20
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:27
#define SETUP_BUFFER(tex, fb, fb_color)
Definition: eevee_effects.c:30
#define CLEANUP_BUFFER(tex, fb, fb_color)
Definition: eevee_effects.c:47
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:23
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:56
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:25
static void downsample_radiance_cb(void *vedata, int level)
static struct @200 e_data
void EEVEE_effects_draw_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
struct GPUTexture * depth_src
Definition: eevee_effects.c:22
DrawEngineType draw_engine_eevee_type
Definition: eevee_engine.c:618
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx GPU_R32F
void EEVEE_lookdev_init(EEVEE_Data *vedata)
Definition: eevee_lookdev.c:84
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:77
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)
Definition: eevee_volumes.c:63
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:31
#define G(x, y, z)
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::@208 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::@210 renderpass_ubo
struct GPUUniformBuf * common_ubo