Blender  V2.93
eevee_render.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 
27 #include "DRW_engine.h"
28 #include "DRW_render.h"
29 
30 #include "DNA_node_types.h"
31 #include "DNA_object_types.h"
32 
33 #include "BKE_global.h"
34 #include "BKE_object.h"
35 
36 #include "BLI_rand.h"
37 #include "BLI_rect.h"
38 
39 #include "DEG_depsgraph_query.h"
40 
41 #include "GPU_capabilities.h"
42 #include "GPU_framebuffer.h"
43 #include "GPU_state.h"
44 
45 #include "RE_pipeline.h"
46 
47 #include "eevee_private.h"
48 
49 /* Return true if init properly. */
51 {
52  EEVEE_Data *vedata = (EEVEE_Data *)ved;
53  EEVEE_StorageList *stl = vedata->stl;
54  EEVEE_TextureList *txl = vedata->txl;
55  EEVEE_FramebufferList *fbl = vedata->fbl;
57  const float *size_orig = DRW_viewport_size_get();
58  float size_final[2];
59 
60  /* Init default FB and render targets:
61  * In render mode the default framebuffer is not generated
62  * because there is no viewport. So we need to manually create it or
63  * not use it. For code clarity we just allocate it make use of it. */
66 
67  /* Alloc transient data. */
68  if (!stl->g_data) {
69  stl->g_data = MEM_callocN(sizeof(*stl->g_data), __func__);
70  }
71  EEVEE_PrivateData *g_data = stl->g_data;
72  g_data->background_alpha = DRW_state_draw_background() ? 1.0f : 0.0f;
73  g_data->valid_double_buffer = 0;
74  copy_v2_v2(g_data->size_orig, size_orig);
75 
76  float *camtexcofac = g_data->camtexcofac;
78  g_data->overscan = scene->eevee.overscan / 100.0f;
79  g_data->overscan_pixels = roundf(max_ff(size_orig[0], size_orig[1]) * g_data->overscan);
80 
81  madd_v2_v2v2fl(size_final, size_orig, (float[2]){2.0f, 2.0f}, g_data->overscan_pixels);
82 
83  camtexcofac[0] = size_final[0] / size_orig[0];
84  camtexcofac[1] = size_final[1] / size_orig[1];
85 
86  camtexcofac[2] = -camtexcofac[0] * g_data->overscan_pixels / size_final[0];
87  camtexcofac[3] = -camtexcofac[1] * g_data->overscan_pixels / size_final[1];
88  }
89  else {
90  copy_v2_v2(size_final, size_orig);
91  g_data->overscan = 0.0f;
92  g_data->overscan_pixels = 0.0f;
93  copy_v4_fl4(camtexcofac, 1.0f, 1.0f, 0.0f, 0.0f);
94  }
95 
96  const int final_res[2] = {
97  size_orig[0] + g_data->overscan_pixels * 2.0f,
98  size_orig[1] + g_data->overscan_pixels * 2.0f,
99  };
100 
101  int max_dim = max_ii(final_res[0], final_res[1]);
102  if (max_dim > GPU_max_texture_size()) {
103  char error_msg[128];
104  BLI_snprintf(error_msg,
105  sizeof(error_msg),
106  "Error: Reported texture size limit (%dpx) is lower than output size (%dpx).",
108  max_dim);
109  RE_engine_set_error_message(engine, error_msg);
110  G.is_break = true;
111  return false;
112  }
113 
114  /* XXX overriding viewport size. Simplify things but is not really 100% safe. */
115  DRW_render_viewport_size_set(final_res);
116 
117  /* TODO 32 bit depth */
120 
121  GPU_framebuffer_ensure_config(
122  &dfbl->default_fb,
123  {GPU_ATTACHMENT_TEXTURE(dtxl->depth), GPU_ATTACHMENT_TEXTURE(txl->color)});
124  GPU_framebuffer_ensure_config(
125  &fbl->main_fb, {GPU_ATTACHMENT_TEXTURE(dtxl->depth), GPU_ATTACHMENT_TEXTURE(txl->color)});
126  GPU_framebuffer_ensure_config(&fbl->main_color_fb,
127  {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->color)});
128 
129  /* Camera could change because of Motion blur. */
130  g_data->cam_original_ob = RE_GetCamera(engine->re);
131 
132  return true;
133 }
134 
136  RenderEngine *engine,
137  struct Depsgraph *depsgraph)
138 {
140  EEVEE_StorageList *stl = vedata->stl;
141  EEVEE_PrivateData *g_data = vedata->stl->g_data;
142  EEVEE_FramebufferList *fbl = vedata->fbl;
143  /* TODO(sergey): Shall render hold pointer to an evaluated camera instead? */
144  struct Object *ob_camera_eval = DEG_get_evaluated_object(depsgraph, g_data->cam_original_ob);
145  EEVEE_render_view_sync(vedata, engine, depsgraph);
146 
147  /* `EEVEE_renderpasses_init` will set the active render passes used by `EEVEE_effects_init`.
148  * `EEVEE_effects_init` needs to go second for TAA. */
149  EEVEE_renderpasses_init(vedata);
150  EEVEE_effects_init(sldata, vedata, ob_camera_eval, false);
151  EEVEE_materials_init(sldata, vedata, stl, fbl);
152  EEVEE_shadows_init(sldata);
153  EEVEE_lightprobes_init(sldata, vedata);
154 }
155 
157 {
158  EEVEE_PrivateData *g_data = vedata->stl->g_data;
159 
160  /* Set the perspective & view matrix. */
161  float winmat[4][4], viewmat[4][4], viewinv[4][4];
162  /* TODO(sergey): Shall render hold pointer to an evaluated camera instead? */
163  struct Object *ob_camera_eval = DEG_get_evaluated_object(depsgraph, g_data->cam_original_ob);
164 
165  RE_GetCameraWindow(engine->re, ob_camera_eval, winmat);
166  RE_GetCameraWindowWithOverscan(engine->re, g_data->overscan, winmat);
167  RE_GetCameraModelMatrix(engine->re, ob_camera_eval, viewinv);
168 
169  invert_m4_m4(viewmat, viewinv);
170 
171  DRWView *view = DRW_view_create(viewmat, winmat, NULL, NULL, NULL);
172  DRW_view_reset();
175 
177 }
178 
180 {
182  EEVEE_bloom_cache_init(sldata, vedata);
183  EEVEE_depth_of_field_cache_init(sldata, vedata);
184  EEVEE_effects_cache_init(sldata, vedata);
185  EEVEE_lightprobes_cache_init(sldata, vedata);
186  EEVEE_lights_cache_init(sldata, vedata);
187  EEVEE_materials_cache_init(sldata, vedata);
188  EEVEE_motion_blur_cache_init(sldata, vedata);
189  EEVEE_occlusion_cache_init(sldata, vedata);
190  EEVEE_screen_raytrace_cache_init(sldata, vedata);
191  EEVEE_subsurface_cache_init(sldata, vedata);
192  EEVEE_temporal_sampling_cache_init(sldata, vedata);
193  EEVEE_volumes_cache_init(sldata, vedata);
194  EEVEE_cryptomatte_cache_init(sldata, vedata);
195 }
196 
197 /* Used by light cache. in this case engine is NULL. */
198 void EEVEE_render_cache(void *vedata,
199  struct Object *ob,
200  struct RenderEngine *engine,
201  struct Depsgraph *depsgraph)
202 {
204  EEVEE_Data *data = vedata;
205  EEVEE_StorageList *stl = data->stl;
206  EEVEE_PrivateData *g_data = stl->g_data;
207  EEVEE_LightProbesInfo *pinfo = sldata->probes;
208  bool cast_shadow = false;
209 
210  const bool do_cryptomatte = (engine != NULL) &&
211  ((g_data->render_passes & EEVEE_RENDER_PASS_CRYPTOMATTE) != 0);
212 
213  eevee_id_update(vedata, &ob->id);
214 
215  if (pinfo->vis_data.collection) {
216  /* Used for rendering probe with visibility groups. */
217  bool ob_vis = BKE_collection_has_object_recursive(pinfo->vis_data.collection, ob);
218  ob_vis = (pinfo->vis_data.invert) ? !ob_vis : ob_vis;
219 
220  if (!ob_vis) {
221  return;
222  }
223  }
224 
225  /* Don't print dupli objects as this can be very verbose and
226  * increase the render time on Windows because of slow windows term.
227  * (see T59649) */
228  if (engine && (ob->base_flag & BASE_FROM_DUPLI) == 0) {
229  char info[42];
230  BLI_snprintf(info, sizeof(info), "Syncing %s", ob->id.name + 2);
231  RE_engine_update_stats(engine, NULL, info);
232  }
233 
234  const int ob_visibility = DRW_object_visibility_in_active_context(ob);
235  if (ob_visibility & OB_VISIBLE_PARTICLES) {
236  EEVEE_particle_hair_cache_populate(vedata, sldata, ob, &cast_shadow);
237  if (do_cryptomatte) {
239  }
240  }
241 
242  if (ob_visibility & OB_VISIBLE_SELF) {
243  if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
244  EEVEE_materials_cache_populate(vedata, sldata, ob, &cast_shadow);
245  if (do_cryptomatte) {
247  }
248  }
249  else if (ob->type == OB_HAIR) {
250  EEVEE_object_hair_cache_populate(vedata, sldata, ob, &cast_shadow);
251  if (do_cryptomatte) {
253  }
254  }
255  else if (ob->type == OB_VOLUME) {
257  EEVEE_volumes_cache_object_add(sldata, vedata, scene, ob);
258  }
259  else if (ob->type == OB_LIGHTPROBE) {
260  EEVEE_lightprobes_cache_add(sldata, vedata, ob);
261  }
262  else if (ob->type == OB_LAMP) {
263  EEVEE_lights_cache_add(sldata, ob);
264  }
265  }
266 
267  if (cast_shadow) {
268  EEVEE_shadows_caster_register(sldata, ob);
269  }
270 }
271 
273  const char *viewname,
274  const rcti *rect,
275  const char *render_pass_name,
276  int num_channels,
277  GPUFrameBuffer *framebuffer,
278  EEVEE_Data *vedata)
279 {
280  RenderPass *rp = RE_pass_find_by_name(rl, render_pass_name, viewname);
281  if (rp == NULL) {
282  return;
283  }
284  GPU_framebuffer_bind(framebuffer);
285  GPU_framebuffer_read_color(framebuffer,
286  vedata->stl->g_data->overscan_pixels + rect->xmin,
287  vedata->stl->g_data->overscan_pixels + rect->ymin,
288  BLI_rcti_size_x(rect),
289  BLI_rcti_size_y(rect),
290  num_channels,
291  0,
293  rp->rect);
294 }
295 
297  const char *viewname,
298  const rcti *rect,
299  EEVEE_Data *vedata,
300  EEVEE_ViewLayerData *UNUSED(sldata))
301 {
303  rl, viewname, rect, RE_PASSNAME_COMBINED, 4, vedata->stl->effects->final_fb, vedata);
304 }
305 
307  const char *viewname,
308  const rcti *rect,
309  EEVEE_Data *vedata,
310  EEVEE_ViewLayerData *sldata)
311 {
312  const int current_sample = vedata->stl->effects->taa_current_sample;
313 
314  /* Only read the center texel. */
315  if (current_sample > 1) {
316  return;
317  }
318 
319  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_NORMAL) != 0) {
322  rl, viewname, rect, RE_PASSNAME_NORMAL, 3, vedata->fbl->renderpass_fb, vedata);
323  }
324 }
325 
327  const char *viewname,
328  const rcti *rect,
329  EEVEE_Data *vedata,
330  EEVEE_ViewLayerData *sldata)
331 {
332  const int current_sample = vedata->stl->effects->taa_current_sample;
333 
334  /* Only read the center texel. */
335  if (current_sample > 1) {
336  return;
337  }
338 
339  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_Z) != 0) {
342  rl, viewname, rect, RE_PASSNAME_Z, 1, vedata->fbl->renderpass_fb, vedata);
343  }
344 }
345 
347  const char *viewname,
348  const rcti *rect,
349  EEVEE_Data *vedata,
350  EEVEE_ViewLayerData *sldata)
351 {
352  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_MIST) != 0) {
355  rl, viewname, rect, RE_PASSNAME_MIST, 1, vedata->fbl->renderpass_fb, vedata);
356  }
357 }
358 
360  const char *viewname,
361  const rcti *rect,
362  EEVEE_Data *vedata,
363  EEVEE_ViewLayerData *sldata)
364 {
365  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_SHADOW) != 0) {
368  rl, viewname, rect, RE_PASSNAME_SHADOW, 3, vedata->fbl->renderpass_fb, vedata);
369  }
370 }
371 
373  const char *viewname,
374  const rcti *rect,
375  EEVEE_Data *vedata,
376  EEVEE_ViewLayerData *sldata)
377 {
378  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_AO) != 0) {
381  rl, viewname, rect, RE_PASSNAME_AO, 3, vedata->fbl->renderpass_fb, vedata);
382  }
383 }
384 
386  const char *viewname,
387  const rcti *rect,
388  EEVEE_Data *vedata,
389  EEVEE_ViewLayerData *sldata)
390 {
391  if ((vedata->stl->effects->enabled_effects & EFFECT_BLOOM) == 0) {
392  /* Bloom is not enabled. */
393  return;
394  }
395 
396  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_BLOOM) != 0) {
399  rl, viewname, rect, RE_PASSNAME_BLOOM, 3, vedata->fbl->renderpass_fb, vedata);
400  }
401 }
402 
403 #define EEVEE_RENDER_RESULT_MATERIAL_PASS(pass_name, eevee_pass_type) \
404  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_##eevee_pass_type) != 0) { \
405  EEVEE_renderpasses_postprocess(sldata, vedata, EEVEE_RENDER_PASS_##eevee_pass_type, 0); \
406  eevee_render_color_result( \
407  rl, viewname, rect, RE_PASSNAME_##pass_name, 3, vedata->fbl->renderpass_fb, vedata); \
408  }
409 
411  const char *viewname,
412  const rcti *rect,
413  EEVEE_Data *vedata,
414  EEVEE_ViewLayerData *sldata)
415 {
416  EEVEE_RENDER_RESULT_MATERIAL_PASS(DIFFUSE_COLOR, DIFFUSE_COLOR)
417 }
418 
420  const char *viewname,
421  const rcti *rect,
422  EEVEE_Data *vedata,
423  EEVEE_ViewLayerData *sldata)
424 {
425  EEVEE_RENDER_RESULT_MATERIAL_PASS(DIFFUSE_DIRECT, DIFFUSE_LIGHT)
426 }
427 
429  const char *viewname,
430  const rcti *rect,
431  EEVEE_Data *vedata,
432  EEVEE_ViewLayerData *sldata)
433 {
434  EEVEE_RENDER_RESULT_MATERIAL_PASS(GLOSSY_COLOR, SPECULAR_COLOR)
435 }
436 
438  const char *viewname,
439  const rcti *rect,
440  EEVEE_Data *vedata,
441  EEVEE_ViewLayerData *sldata)
442 {
443  EEVEE_RENDER_RESULT_MATERIAL_PASS(GLOSSY_DIRECT, SPECULAR_LIGHT)
444 }
445 
447  const char *viewname,
448  const rcti *rect,
449  EEVEE_Data *vedata,
450  EEVEE_ViewLayerData *sldata)
451 {
453 }
454 
456  const char *viewname,
457  const rcti *rect,
458  EEVEE_Data *vedata,
459  EEVEE_ViewLayerData *sldata)
460 {
461  EEVEE_RENDER_RESULT_MATERIAL_PASS(ENVIRONMENT, ENVIRONMENT)
462 }
463 
465  const char *viewname,
466  const rcti *rect,
467  EEVEE_Data *vedata,
468  EEVEE_ViewLayerData *sldata)
469 {
470  EEVEE_RENDER_RESULT_MATERIAL_PASS(VOLUME_LIGHT, VOLUME_LIGHT)
471 }
472 
474  const char *viewname,
475  const rcti *rect,
476  EEVEE_Data *vedata,
477  EEVEE_ViewLayerData *sldata)
478 {
479  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_AOV) != 0) {
480  const DRWContextState *draw_ctx = DRW_context_state_get();
481  ViewLayer *view_layer = draw_ctx->view_layer;
482  int aov_index = 0;
483  LISTBASE_FOREACH (ViewLayerAOV *, aov, &view_layer->aovs) {
484  if ((aov->flag & AOV_CONFLICT) != 0) {
485  continue;
486  }
487  EEVEE_renderpasses_postprocess(sldata, vedata, EEVEE_RENDER_PASS_AOV, aov_index);
488  switch (aov->type) {
489  case AOV_TYPE_COLOR:
491  rl, viewname, rect, aov->name, 4, vedata->fbl->renderpass_fb, vedata);
492  break;
493  case AOV_TYPE_VALUE:
495  rl, viewname, rect, aov->name, 1, vedata->fbl->renderpass_fb, vedata);
496  }
497  aov_index++;
498  }
499  }
500 }
501 
502 #undef EEVEE_RENDER_RESULT_MATERIAL_PASS
503 
505  const char *viewname,
506  const rcti *rect,
507  EEVEE_Data *vedata,
508  EEVEE_ViewLayerData *sldata)
509 {
510  if ((vedata->stl->g_data->render_passes & EEVEE_RENDER_PASS_CRYPTOMATTE) != 0) {
511  EEVEE_cryptomatte_render_result(rl, viewname, rect, vedata, sldata);
512  }
513 }
514 
516 {
517  EEVEE_FramebufferList *fbl = vedata->fbl;
518  EEVEE_StorageList *stl = vedata->stl;
519  EEVEE_PassList *psl = vedata->psl;
520 
521  /* Prevent background to write to data buffers.
522  * NOTE : This also make sure the textures are bound
523  * to the right double buffer. */
524  GPU_framebuffer_ensure_config(&fbl->main_fb,
525  {GPU_ATTACHMENT_LEAVE,
526  GPU_ATTACHMENT_LEAVE,
527  GPU_ATTACHMENT_NONE,
528  GPU_ATTACHMENT_NONE,
529  GPU_ATTACHMENT_NONE,
530  GPU_ATTACHMENT_NONE});
532 
534 
535  GPU_framebuffer_ensure_config(&fbl->main_fb,
536  {GPU_ATTACHMENT_LEAVE,
537  GPU_ATTACHMENT_LEAVE,
538  GPU_ATTACHMENT_TEXTURE(stl->effects->ssr_normal_input),
539  GPU_ATTACHMENT_TEXTURE(stl->effects->ssr_specrough_input),
540  GPU_ATTACHMENT_TEXTURE(stl->effects->sss_irradiance),
541  GPU_ATTACHMENT_TEXTURE(stl->effects->sss_radius),
542  GPU_ATTACHMENT_TEXTURE(stl->effects->sss_albedo)});
544 }
545 
546 void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl, const rcti *rect)
547 {
548  const char *viewname = RE_GetActiveRenderView(engine->re);
549  EEVEE_PassList *psl = vedata->psl;
550  EEVEE_StorageList *stl = vedata->stl;
551  EEVEE_FramebufferList *fbl = vedata->fbl;
554 
555  /* Push instances attributes to the GPU. */
557 
558  /* Need to be called after DRW_render_instance_buffer_finish() */
559  /* Also we weed to have a correct FBO bound for DRW_hair_update */
561  DRW_hair_update();
562 
563  /* Sort transparents before the loop. */
565 
566  uint tot_sample = stl->g_data->render_sample_count_per_timestep;
567  uint render_samples = 0;
568 
569  /* SSR needs one iteration to start properly. */
571  tot_sample += 1;
572  }
573 
574  while (render_samples < tot_sample && !RE_engine_test_break(engine)) {
575  const float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
576  float clear_depth = 1.0f;
577  uint clear_stencil = 0x00;
578  const uint primes[3] = {2, 3, 7};
579  double offset[3] = {0.0, 0.0, 0.0};
580  double r[3];
581 
582  if ((stl->effects->enabled_effects & EFFECT_SSR) && (render_samples == 1) &&
584  /* SSR needs one iteration to start properly.
585  * This iteration was done, reset to the original target sample count. */
586  render_samples--;
587  tot_sample--;
588  /* Reset sampling (and accumulation) after the first sample to avoid
589  * washed out first bounce for SSR. */
592  }
593  /* Don't print every samples as it can lead to bad performance. (see T59649) */
594  else if ((render_samples % 25) == 0 || (render_samples + 1) == tot_sample) {
595  char info[42];
596  BLI_snprintf(
597  info, sizeof(info), "Rendering %u / %u samples", render_samples + 1, tot_sample);
598  RE_engine_update_stats(engine, NULL, info);
599  }
600 
601  /* Copy previous persmat to UBO data */
603 
604  BLI_halton_3d(primes, offset, stl->effects->taa_current_sample, r);
605  EEVEE_update_noise(psl, fbl, r);
608  EEVEE_materials_init(sldata, vedata, stl, fbl);
609 
610  /* Refresh Probes
611  * Shadows needs to be updated for correct probes */
612  EEVEE_shadows_update(sldata, vedata);
613  EEVEE_lightprobes_refresh(sldata, vedata);
614  EEVEE_lightprobes_refresh_planar(sldata, vedata);
615 
616  /* Refresh Shadows */
617  EEVEE_shadows_draw(sldata, vedata, stl->effects->taa_view);
618 
619  /* Set matrices. */
621 
622  /* Set ray type. */
624  sldata->common_data.ray_depth = 0.0f;
625  GPU_uniformbuf_update(sldata->common_ubo, &sldata->common_data);
626 
628  GPU_framebuffer_clear_color_depth_stencil(fbl->main_fb, clear_col, clear_depth, clear_stencil);
629  /* Depth prepass */
630  DRW_draw_pass(psl->depth_ps);
631  /* Create minmax texture */
632  EEVEE_create_minmax_buffer(vedata, dtxl->depth, -1);
633  EEVEE_occlusion_compute(sldata, vedata);
634  EEVEE_volumes_compute(sldata, vedata);
635  /* Shading pass */
639  EEVEE_subsurface_data_render(sldata, vedata);
640  /* Effects pre-transparency */
641  EEVEE_subsurface_compute(sldata, vedata);
642  EEVEE_reflection_compute(sldata, vedata);
643  EEVEE_refraction_compute(sldata, vedata);
644  /* Opaque refraction */
647  /* Result NORMAL */
648  eevee_render_result_normal(rl, viewname, rect, vedata, sldata);
649  /* Volumetrics Resolve Opaque */
650  EEVEE_volumes_resolve(sldata, vedata);
651  /* Subsurface output, Occlusion output, Mist output */
652  EEVEE_renderpasses_output_accumulate(sldata, vedata, false);
653  /* Transparent */
659  /* Result Z */
660  eevee_render_result_z(rl, viewname, rect, vedata, sldata);
661  /* Post Process */
662  EEVEE_draw_effects(sldata, vedata);
663 
664  /* XXX Seems to fix TDR issue with NVidia drivers on linux. */
665  GPU_finish();
666 
667  RE_engine_update_progress(engine, (float)(render_samples++) / (float)tot_sample);
668  }
669 }
670 
672  RenderEngine *engine,
673  RenderLayer *rl,
674  const rcti *rect)
675 {
676  const char *viewname = RE_GetActiveRenderView(engine->re);
678 
679  eevee_render_result_combined(rl, viewname, rect, vedata, sldata);
680  eevee_render_result_mist(rl, viewname, rect, vedata, sldata);
681  eevee_render_result_occlusion(rl, viewname, rect, vedata, sldata);
682  eevee_render_result_shadow(rl, viewname, rect, vedata, sldata);
683  eevee_render_result_diffuse_color(rl, viewname, rect, vedata, sldata);
684  eevee_render_result_diffuse_direct(rl, viewname, rect, vedata, sldata);
685  eevee_render_result_specular_color(rl, viewname, rect, vedata, sldata);
686  eevee_render_result_specular_direct(rl, viewname, rect, vedata, sldata);
687  eevee_render_result_emission(rl, viewname, rect, vedata, sldata);
688  eevee_render_result_environment(rl, viewname, rect, vedata, sldata);
689  eevee_render_result_bloom(rl, viewname, rect, vedata, sldata);
690  eevee_render_result_volume_light(rl, viewname, rect, vedata, sldata);
691  eevee_render_result_aovs(rl, viewname, rect, vedata, sldata);
692  eevee_render_result_cryptomatte(rl, viewname, rect, vedata, sldata);
693 }
694 
696 {
697  RE_engine_register_pass(engine, scene, view_layer, RE_PASSNAME_COMBINED, 4, "RGBA", SOCK_RGBA);
698 
699 #define CHECK_PASS_LEGACY(name, type, channels, chanid) \
700  if (view_layer->passflag & (SCE_PASS_##name)) { \
701  RE_engine_register_pass( \
702  engine, scene, view_layer, RE_PASSNAME_##name, channels, chanid, type); \
703  } \
704  ((void)0)
705 #define CHECK_PASS_EEVEE(name, type, channels, chanid) \
706  if (view_layer->eevee.render_passes & (EEVEE_RENDER_PASS_##name)) { \
707  RE_engine_register_pass( \
708  engine, scene, view_layer, RE_PASSNAME_##name, channels, chanid, type); \
709  } \
710  ((void)0)
711 
712  CHECK_PASS_LEGACY(Z, SOCK_FLOAT, 1, "Z");
713  CHECK_PASS_LEGACY(MIST, SOCK_FLOAT, 1, "Z");
715  CHECK_PASS_LEGACY(SHADOW, SOCK_RGBA, 3, "RGB");
716  CHECK_PASS_LEGACY(AO, SOCK_RGBA, 3, "RGB");
717  CHECK_PASS_LEGACY(DIFFUSE_COLOR, SOCK_RGBA, 3, "RGB");
718  CHECK_PASS_LEGACY(DIFFUSE_DIRECT, SOCK_RGBA, 3, "RGB");
719  CHECK_PASS_LEGACY(GLOSSY_COLOR, SOCK_RGBA, 3, "RGB");
720  CHECK_PASS_LEGACY(GLOSSY_DIRECT, SOCK_RGBA, 3, "RGB");
721  CHECK_PASS_LEGACY(EMIT, SOCK_RGBA, 3, "RGB");
722  CHECK_PASS_LEGACY(ENVIRONMENT, SOCK_RGBA, 3, "RGB");
723  CHECK_PASS_EEVEE(VOLUME_LIGHT, SOCK_RGBA, 3, "RGB");
724  CHECK_PASS_EEVEE(BLOOM, SOCK_RGBA, 3, "RGB");
725 
726  LISTBASE_FOREACH (ViewLayerAOV *, aov, &view_layer->aovs) {
727  if ((aov->flag & AOV_CONFLICT) != 0) {
728  continue;
729  }
730  switch (aov->type) {
731  case AOV_TYPE_COLOR:
732  RE_engine_register_pass(engine, scene, view_layer, aov->name, 4, "RGBA", SOCK_RGBA);
733  break;
734  case AOV_TYPE_VALUE:
735  RE_engine_register_pass(engine, scene, view_layer, aov->name, 1, "X", SOCK_FLOAT);
736  break;
737  default:
738  break;
739  }
740  }
741  EEVEE_cryptomatte_update_passes(engine, scene, view_layer);
742 
743 #undef CHECK_PASS_LEGACY
744 #undef CHECK_PASS_EEVEE
745 }
bool BKE_collection_has_object_recursive(struct Collection *collection, struct Object *ob)
Definition: collection.c:961
General operations, lookup, etc. for blender objects.
@ OB_VISIBLE_SELF
Definition: BKE_object.h:125
@ OB_VISIBLE_PARTICLES
Definition: BKE_object.h:126
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
MINLINE float max_ff(float a, float b)
MINLINE int max_ii(int a, int b)
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
Random number functions.
void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double *r)
Definition: rand.cc:323
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNUSED(x)
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_BLOOM
@ EEVEE_RENDER_PASS_CRYPTOMATTE
@ EEVEE_RENDER_PASS_Z
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_SHADOW
@ BASE_FROM_DUPLI
@ AOV_TYPE_COLOR
@ AOV_TYPE_VALUE
@ AOV_CONFLICT
@ SOCK_VECTOR
@ SOCK_FLOAT
@ SOCK_RGBA
Object is a sort of wrapper for general info.
@ OB_MBALL
@ OB_SURF
@ OB_FONT
@ OB_LAMP
@ OB_MESH
@ OB_HAIR
@ OB_VOLUME
@ OB_CURVE
@ OB_LIGHTPROBE
#define RE_PASSNAME_COMBINED
#define RE_PASSNAME_BLOOM
#define RE_PASSNAME_NORMAL
#define RE_PASSNAME_SHADOW
#define RE_PASSNAME_MIST
#define RE_PASSNAME_AO
#define RE_PASSNAME_Z
@ SCE_EEVEE_OVERSCAN
@ DRW_TEX_FILTER
Definition: DRW_render.h:139
static AppView * view
int GPU_max_texture_size(void)
struct GPUFrameBuffer GPUFrameBuffer
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex)
_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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
void GPU_finish(void)
Definition: gpu_state.cc:316
@ GPU_DATA_FLOAT
Definition: GPU_texture.h:172
@ GPU_DEPTH24_STENCIL8
Definition: GPU_texture.h:121
@ GPU_RGBA32F
Definition: GPU_texture.h:91
void GPU_uniformbuf_update(GPUUniformBuf *ubo, const void *data)
#define Z
Definition: GeomUtils.cpp:215
Group RGB to NORMAL
Scene scene
const Depsgraph * depsgraph
void DRW_hair_update(void)
Definition: draw_hair.c:300
void DRW_render_viewport_size_set(const int size[2])
Definition: draw_manager.c:431
DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
Definition: draw_manager.c:697
void DRW_render_instance_buffer_finish(void)
int DRW_object_visibility_in_active_context(const Object *ob)
Definition: draw_manager.c:235
const DRWContextState * DRW_context_state_get(void)
bool DRW_state_draw_background(void)
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:439
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:702
void DRW_pass_sort_shgroup_z(DRWPass *pass)
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_default_set(DRWView *view)
void DRW_view_camtexco_set(DRWView *view, float texco[4])
void DRW_view_reset(void)
void DRW_view_set_active(DRWView *view)
void DRW_draw_pass(DRWPass *pass)
void DRW_texture_ensure_fullscreen_2d(GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags)
void EEVEE_bloom_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
Definition: eevee_bloom.c:165
void EEVEE_cryptomatte_particle_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob)
void EEVEE_cryptomatte_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob)
void EEVEE_cryptomatte_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
void EEVEE_cryptomatte_object_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob)
void EEVEE_cryptomatte_render_result(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *UNUSED(sldata))
void EEVEE_cryptomatte_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
EEVEE_ViewLayerData * EEVEE_view_layer_data_ensure(void)
Definition: eevee_data.c:276
void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int layer)
void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
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
void eevee_id_update(void *vedata, ID *id)
Definition: eevee_engine.c:420
void EEVEE_lightprobes_refresh(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Object *ob)
void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
Definition: eevee_lights.c:216
void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
Definition: eevee_lights.c:208
void EEVEE_update_noise(EEVEE_PassList *psl, EEVEE_FramebufferList *fbl, const double offsets[3])
void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_object_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow)
void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow)
void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_StorageList *stl, EEVEE_FramebufferList *fbl)
void EEVEE_particle_hair_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, Object *ob, bool *cast_shadow)
void EEVEE_motion_blur_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_occlusion_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_refraction_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_shadows_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_renderpasses_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, bool post_effect)
void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, uint current_sample)
Definition: eevee_volumes.c:90
void EEVEE_subsurface_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_volumes_resolve(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_temporal_sampling_matrices_calc(EEVEE_EffectsInfo *effects, const double ht_point[2])
void EEVEE_reflection_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, struct Scene *scene, Object *ob)
void EEVEE_temporal_sampling_reset(EEVEE_Data *vedata)
void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_renderpasses_init(EEVEE_Data *vedata)
void EEVEE_subsurface_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
#define EEVEE_RAY_CAMERA
void EEVEE_shadows_caster_register(EEVEE_ViewLayerData *sldata, struct Object *ob)
void EEVEE_shadows_init(EEVEE_ViewLayerData *sldata)
Definition: eevee_shadows.c:41
@ EFFECT_BLOOM
@ EFFECT_SSR
void EEVEE_temporal_sampling_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_shadows_draw(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, struct DRWView *view)
void EEVEE_renderpasses_postprocess(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, eViewLayerEEVEEPassType renderpass_type, int aov_index)
void EEVEE_subsurface_data_render(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
static void eevee_render_result_aovs(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:473
static void eevee_render_result_emission(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:446
static void eevee_render_result_specular_color(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:428
static void eevee_render_result_volume_light(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:464
static void eevee_render_result_combined(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *UNUSED(sldata))
Definition: eevee_render.c:296
void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl, const rcti *rect)
Definition: eevee_render.c:546
static void eevee_render_draw_background(EEVEE_Data *vedata)
Definition: eevee_render.c:515
static void eevee_render_result_mist(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:346
void EEVEE_render_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
Definition: eevee_render.c:695
static void eevee_render_result_diffuse_direct(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:419
#define CHECK_PASS_EEVEE(name, type, channels, chanid)
void EEVEE_render_modules_init(EEVEE_Data *vedata, RenderEngine *engine, struct Depsgraph *depsgraph)
Definition: eevee_render.c:135
void EEVEE_render_cache(void *vedata, struct Object *ob, struct RenderEngine *engine, struct Depsgraph *depsgraph)
Definition: eevee_render.c:198
void EEVEE_render_view_sync(EEVEE_Data *vedata, RenderEngine *engine, struct Depsgraph *depsgraph)
Definition: eevee_render.c:156
#define EEVEE_RENDER_RESULT_MATERIAL_PASS(pass_name, eevee_pass_type)
Definition: eevee_render.c:403
#define CHECK_PASS_LEGACY(name, type, channels, chanid)
static void eevee_render_result_diffuse_color(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:410
static void eevee_render_result_shadow(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:359
void EEVEE_render_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
Definition: eevee_render.c:179
static void eevee_render_result_environment(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:455
static void eevee_render_result_occlusion(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:372
bool EEVEE_render_init(EEVEE_Data *ved, RenderEngine *engine, struct Depsgraph *depsgraph)
Definition: eevee_render.c:50
static void eevee_render_color_result(RenderLayer *rl, const char *viewname, const rcti *rect, const char *render_pass_name, int num_channels, GPUFrameBuffer *framebuffer, EEVEE_Data *vedata)
Definition: eevee_render.c:272
void EEVEE_render_read_result(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl, const rcti *rect)
Definition: eevee_render.c:671
static void eevee_render_result_normal(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:306
static void eevee_render_result_bloom(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:385
static void eevee_render_result_cryptomatte(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:504
static void eevee_render_result_z(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:326
static void eevee_render_result_specular_direct(RenderLayer *rl, const char *viewname, const rcti *rect, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata)
Definition: eevee_render.c:437
bool RE_engine_test_break(RenderEngine *engine)
Definition: engine.c:435
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, const char *name, int channels, const char *chanid, eNodeSocketDatatype type)
Definition: engine.c:1092
void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info)
Definition: engine.c:448
void RE_engine_set_error_message(RenderEngine *engine, const char *msg)
Definition: engine.c:507
void RE_engine_update_progress(RenderEngine *engine, float progress)
Definition: engine.c:475
void GPU_framebuffer_read_color(GPUFrameBuffer *gpu_fb, int x, int y, int w, int h, int channels, int slot, eGPUDataFormat format, void *data)
void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
void RE_GetCameraWindowWithOverscan(struct Render *re, float overscan, float r_winmat[4][4])
Definition: initrender.c:212
void RE_GetCameraWindow(struct Render *re, struct Object *camera, float r_winmat[4][4])
Definition: initrender.c:205
void RE_GetCameraModelMatrix(Render *re, struct Object *camera, float r_modelmat[4][4])
Definition: initrender.c:230
struct Object * RE_GetCamera(Render *re)
Definition: initrender.c:169
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
RenderPass * RE_pass_find_by_name(volatile RenderLayer *rl, const char *name, const char *viewname)
Definition: pipeline.c:2764
const char * RE_GetActiveRenderView(Render *re)
Definition: pipeline.c:1746
struct ViewLayer * view_layer
Definition: DRW_render.h:746
struct GPUFrameBuffer * default_fb
struct GPUTexture * depth
EEVEE_TextureList * txl
EEVEE_StorageList * stl
EEVEE_PassList * psl
EEVEE_FramebufferList * fbl
bool ssr_was_valid_double_buffer
EEVEE_EffectsFlag enabled_effects
float prev_persmat[4][4]
struct GPUFrameBuffer * final_fb
struct DRWView * taa_view
struct GPUFrameBuffer * main_fb
struct GPUFrameBuffer * main_color_fb
struct GPUFrameBuffer * renderpass_fb
struct Collection * collection
EEVEE_LightProbeVisTest vis_data
struct DRWPass * transparent_pass
struct DRWPass * depth_refract_ps
struct DRWPass * depth_ps
struct DRWPass * material_refract_ps
struct DRWPass * material_ps
struct DRWPass * background_ps
eViewLayerEEVEEPassType render_passes
struct Object * cam_original_ob
int render_sample_count_per_timestep
struct EEVEE_PrivateData * g_data
struct EEVEE_EffectsInfo * effects
struct GPUTexture * color
struct EEVEE_CommonUniformBuffer common_data
struct GPUUniformBuf * common_ubo
struct EEVEE_LightProbesInfo * probes
char name[66]
Definition: DNA_ID.h:283
short base_flag
struct Render * re
Definition: RE_engine.h:136
float * rect
Definition: RE_pipeline.h:82
struct SceneEEVEE eevee
ListBase aovs
char name[64]
int ymin
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
#define G(x, y, z)