Blender  V3.3
eevee_temporal_sampling.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 "ED_screen.h"
13 
14 #include "BLI_rand.h"
15 
16 #include "DEG_depsgraph_query.h"
17 
18 #include "GPU_texture.h"
19 #include "eevee_private.h"
20 
21 #define FILTER_CDF_TABLE_SIZE 512
22 
23 static struct {
24  /* Pixel filter table: Only blackman-harris for now. */
25  bool inited;
27 } e_data = {false}; /* Engine data */
28 
29 static float UNUSED_FUNCTION(filter_box)(float UNUSED(x))
30 {
31  return 1.0f;
32 }
33 
34 static float filter_blackman_harris(float x)
35 {
36  /* Hardcoded 1px footprint [-0.5..0.5]. We resize later. */
37  const float width = 1.0f;
38  x = 2.0f * M_PI * (x / width + 0.5f);
39  return 0.35875f - 0.48829f * cosf(x) + 0.14128f * cosf(2.0f * x) - 0.01168f * cosf(3.0f * x);
40 }
41 
42 /* Compute cumulative distribution function of a discrete function. */
43 static void compute_cdf(float (*func)(float x), float cdf[FILTER_CDF_TABLE_SIZE])
44 {
45  cdf[0] = 0.0f;
46  /* Actual CDF evaluation. */
47  for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) {
48  float x = (float)(u + 1) / (float)(FILTER_CDF_TABLE_SIZE - 1);
49  cdf[u + 1] = cdf[u] + func(x - 0.5f); /* [-0.5..0.5]. We resize later. */
50  }
51  /* Normalize the CDF. */
52  for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) {
53  cdf[u] /= cdf[FILTER_CDF_TABLE_SIZE - 1];
54  }
55  /* Just to make sure. */
56  cdf[FILTER_CDF_TABLE_SIZE - 1] = 1.0f;
57 }
58 
59 static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE],
61 {
62  for (int u = 0; u < FILTER_CDF_TABLE_SIZE; u++) {
63  float x = (float)u / (float)(FILTER_CDF_TABLE_SIZE - 1);
64  for (int i = 0; i < FILTER_CDF_TABLE_SIZE; i++) {
65  if (cdf[i] >= x) {
66  if (i == FILTER_CDF_TABLE_SIZE - 1) {
67  invert_cdf[u] = 1.0f;
68  }
69  else {
70  float t = (x - cdf[i]) / (cdf[i + 1] - cdf[i]);
71  invert_cdf[u] = ((float)i + t) / (float)(FILTER_CDF_TABLE_SIZE - 1);
72  }
73  break;
74  }
75  }
76  }
77 }
78 
79 /* Evaluate a discrete function table with linear interpolation. */
80 static float eval_table(const float *table, float x)
81 {
82  CLAMP(x, 0.0f, 1.0f);
83  x = x * (FILTER_CDF_TABLE_SIZE - 1);
84 
85  int index = min_ii((int)(x), FILTER_CDF_TABLE_SIZE - 1);
86  int nindex = min_ii(index + 1, FILTER_CDF_TABLE_SIZE - 1);
87  float t = x - index;
88 
89  return (1.0f - t) * table[index] + t * table[nindex];
90 }
91 
93 {
94  float *cdf_table = MEM_mallocN(sizeof(float) * FILTER_CDF_TABLE_SIZE, "Eevee Filter CDF table");
95 
96  float filter_width = 2.0f; /* Use a 2 pixel footprint by default. */
97 
98  {
99  /* Use blackman-harris filter. */
100  filter_width *= 2.0f;
102  }
103 
104  invert_cdf(cdf_table, e_data.inverted_cdf);
105 
106  /* Scale and offset table. */
107  for (int i = 0; i < FILTER_CDF_TABLE_SIZE; i++) {
108  e_data.inverted_cdf[i] = (e_data.inverted_cdf[i] - 0.5f) * filter_width;
109  }
110 
111  MEM_freeN(cdf_table);
112  e_data.inited = true;
113 }
114 
115 void EEVEE_temporal_sampling_offset_calc(const double ht_point[2],
116  const float filter_size,
117  float r_offset[2])
118 {
119  r_offset[0] = eval_table(e_data.inverted_cdf, (float)(ht_point[0])) * filter_size;
120  r_offset[1] = eval_table(e_data.inverted_cdf, (float)(ht_point[1])) * filter_size;
121 }
122 
123 void EEVEE_temporal_sampling_matrices_calc(EEVEE_EffectsInfo *effects, const double ht_point[2])
124 {
125  const float *viewport_size = DRW_viewport_size_get();
126  const DRWContextState *draw_ctx = DRW_context_state_get();
127  Scene *scene = draw_ctx->scene;
128  RenderData *rd = &scene->r;
129 
130  float persmat[4][4], viewmat[4][4], winmat[4][4], wininv[4][4];
131  DRW_view_persmat_get(NULL, persmat, false);
132  DRW_view_viewmat_get(NULL, viewmat, false);
133  DRW_view_winmat_get(NULL, winmat, false);
134  DRW_view_winmat_get(NULL, wininv, true);
135 
136  float ofs[2];
137  EEVEE_temporal_sampling_offset_calc(ht_point, rd->gauss, ofs);
138 
139  if (effects->taa_current_sample > 1) {
140  window_translate_m4(winmat, persmat, ofs[0] / viewport_size[0], ofs[1] / viewport_size[1]);
141  }
142 
143  /* Jitter is in pixel space. Focus distance in world space units. */
144  float dof_jitter[2], focus_distance;
145  if (EEVEE_depth_of_field_jitter_get(effects, dof_jitter, &focus_distance)) {
146  /* Convert to NDC space [-1..1]. */
147  dof_jitter[0] /= viewport_size[0] * 0.5f;
148  dof_jitter[1] /= viewport_size[1] * 0.5f;
149 
150  /* Skew the projection matrix in the ray direction and offset it to ray origin.
151  * Make it focus at focus_distance. */
152  if (winmat[2][3] != -1.0f) {
153  /* Orthographic */
154  add_v2_v2(winmat[2], dof_jitter);
155 
157  winmat, persmat, dof_jitter[0] * focus_distance, dof_jitter[1] * focus_distance);
158  }
159  else {
160  /* Get focus distance in NDC. */
161  float focus_pt[3] = {0.0f, 0.0f, -focus_distance};
162  mul_project_m4_v3(winmat, focus_pt);
163  /* Get pixel footprint in view-space. */
164  float jitter_scaled[3] = {dof_jitter[0], dof_jitter[1], focus_pt[2]};
165  float center[3] = {0.0f, 0.0f, focus_pt[2]};
166  mul_project_m4_v3(wininv, jitter_scaled);
167  mul_project_m4_v3(wininv, center);
168 
169  /* FIXME(fclem): The offset is noticeably large and the culling might make object pop out
170  * of the blurring radius. To fix this, use custom enlarged culling matrix. */
171  sub_v2_v2v2(jitter_scaled, jitter_scaled, center);
172  add_v2_v2(viewmat[3], jitter_scaled);
173 
174  window_translate_m4(winmat, persmat, -dof_jitter[0], -dof_jitter[1]);
175  }
176  }
177 
178  BLI_assert(effects->taa_view != NULL);
179 
180  /* When rendering just update the view. This avoids recomputing the culling. */
181  DRW_view_update_sub(effects->taa_view, viewmat, winmat);
182 }
183 
185 {
186  EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl;
187  EEVEE_EffectsInfo *effects = stl->effects;
188 
189  double ht_point[2];
190  double ht_offset[2] = {0.0, 0.0};
191  const uint ht_primes[2] = {2, 3};
192 
193  BLI_halton_2d(ht_primes, ht_offset, effects->taa_current_sample - 1, ht_point);
194 
195  EEVEE_temporal_sampling_matrices_calc(effects, ht_point);
196 
197  DRW_view_set_active(effects->taa_view);
198 }
199 
201 {
202  vedata->stl->effects->taa_render_sample = 1;
203  vedata->stl->effects->taa_current_sample = 1;
204 }
205 
207 {
208  EEVEE_EffectsInfo *effects = vedata->stl->effects;
209  /* Create a sub view to disable clipping planes (if any). */
210  const DRWView *default_view = DRW_view_default_get();
211  float viewmat[4][4], winmat[4][4];
212  DRW_view_viewmat_get(default_view, viewmat, false);
213  DRW_view_winmat_get(default_view, winmat, false);
214  effects->taa_view = DRW_view_create_sub(default_view, viewmat, winmat);
215  DRW_view_clip_planes_set(effects->taa_view, NULL, 0);
216 }
217 
219 {
220  const bool is_render = DRW_state_is_image_render();
221  int sample_count = is_render ? scene->eevee.taa_render_samples : scene->eevee.taa_samples;
222  int timesteps = is_render ? stl->g_data->render_timesteps : 1;
223 
224  sample_count = max_ii(0, sample_count);
225  sample_count = (sample_count == 0) ? TAA_MAX_SAMPLE : sample_count;
226  sample_count = divide_ceil_u(sample_count, timesteps);
227 
228  int dof_sample_count = EEVEE_depth_of_field_sample_count_get(stl->effects, sample_count, NULL);
229  sample_count = dof_sample_count * divide_ceil_u(sample_count, dof_sample_count);
230  return sample_count;
231 }
232 
234 {
235  EEVEE_StorageList *stl = vedata->stl;
236  EEVEE_EffectsInfo *effects = stl->effects;
237  int repro_flag = 0;
238 
239  if (!e_data.inited) {
241  }
242 
248  effects->taa_render_sample = 1;
249  }
250  effects->bypass_drawing = false;
251 
253 
254  const DRWContextState *draw_ctx = DRW_context_state_get();
255  const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
256 
257  if ((scene_eval->eevee.taa_samples != 1) || DRW_state_is_image_render()) {
258  float persmat[4][4];
259 
263  effects->taa_reproject_sample = ((effects->taa_reproject_sample + 1) % 16);
264  }
265 
266  /* Until we support reprojection, we need to make sure
267  * that the history buffer contains correct information. */
268  bool view_is_valid = stl->g_data->valid_double_buffer;
269 
270  view_is_valid = view_is_valid && (stl->g_data->view_updated == false);
271 
272  if (draw_ctx->evil_C != NULL) {
273  struct wmWindowManager *wm = CTX_wm_manager(draw_ctx->evil_C);
274  view_is_valid = view_is_valid && (ED_screen_animation_no_scrub(wm) == NULL);
275  }
276 
278 
280  view_is_valid = false;
281  effects->taa_total_sample = 1;
282  }
283 
284  /* Motion blur steps could reset the sampling when camera is animated (see T79970). */
285  if (!DRW_state_is_scene_render()) {
286  DRW_view_persmat_get(NULL, persmat, false);
287  view_is_valid = view_is_valid && compare_m4m4(persmat, effects->prev_drw_persmat, FLT_MIN);
288  }
289 
290  /* Prevent ghosting from probe data. */
291  view_is_valid = view_is_valid && (effects->prev_drw_support == DRW_state_draw_support()) &&
295 
296  if (((effects->taa_total_sample == 0) ||
297  (effects->taa_current_sample < effects->taa_total_sample)) ||
298  (!view_is_valid) || DRW_state_is_image_render()) {
299  if (view_is_valid) {
300  /* Viewport rendering updates the matrices in `eevee_draw_scene` */
301  if (!DRW_state_is_image_render()) {
302  effects->taa_current_sample += 1;
303  repro_flag = 0;
304  }
305  }
306  else {
307  effects->taa_current_sample = 1;
308  }
309  }
310  else {
311  const bool all_shaders_compiled = stl->g_data->queued_shaders_count_prev == 0;
312  /* Fix Texture painting (see T79370) and shader compilation (see T78520). */
313  if (DRW_state_is_navigating() || !all_shaders_compiled) {
314  effects->taa_current_sample = 1;
315  }
316  else {
317  effects->bypass_drawing = true;
318  }
319  }
320 
323  }
324 
325  effects->taa_current_sample = 1;
326 
327  return repro_flag;
328 }
329 
331 {
332  EEVEE_PassList *psl = vedata->psl;
333  EEVEE_StorageList *stl = vedata->stl;
334  EEVEE_TextureList *txl = vedata->txl;
335  EEVEE_EffectsInfo *effects = stl->effects;
336 
337  if (effects->enabled_effects & EFFECT_TAA) {
339 
342 
343  DRW_shgroup_uniform_texture_ref(grp, "colorHistoryBuffer", &txl->taa_history);
344  DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer);
345  DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo);
346  DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined);
347 
348  if (effects->enabled_effects & EFFECT_TAA_REPROJECT) {
350  DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &dtxl->depth);
351  DRW_shgroup_uniform_mat4(grp, "prevViewProjectionMatrix", effects->prev_drw_persmat);
352  }
353  else {
354  DRW_shgroup_uniform_float(grp, "alpha", &effects->taa_alpha, 1);
355  }
357  }
358 }
359 
361 {
362  EEVEE_PassList *psl = vedata->psl;
363  EEVEE_TextureList *txl = vedata->txl;
364  EEVEE_FramebufferList *fbl = vedata->fbl;
365  EEVEE_StorageList *stl = vedata->stl;
366  EEVEE_EffectsInfo *effects = stl->effects;
367 
368  if ((effects->enabled_effects & (EFFECT_TAA | EFFECT_TAA_REPROJECT)) != 0) {
369  if ((effects->enabled_effects & EFFECT_TAA) != 0 && effects->taa_current_sample != 1) {
371  /* See EEVEE_temporal_sampling_init() for more details. */
372  effects->taa_alpha = 1.0f / (float)(effects->taa_render_sample);
373  }
374  else {
375  effects->taa_alpha = 1.0f / (float)(effects->taa_current_sample);
376  }
377 
380 
381  /* Restore the depth from sample 1. */
383 
385  }
386  else {
387  /* Save the depth buffer for the next frame.
388  * This saves us from doing anything special
389  * in the other mode engines. */
391 
392  /* Do reprojection for noise reduction */
393  /* TODO: do AA jitter if in only render view. */
394  if (!DRW_state_is_image_render() && (effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0 &&
395  stl->g_data->valid_taa_history) {
399  }
400  else {
401  struct GPUFrameBuffer *source_fb = (effects->target_buffer == fbl->main_color_fb) ?
402  fbl->effect_color_fb :
403  fbl->main_color_fb;
405  }
406  }
407 
408  /* Make each loop count when doing a render. */
410  effects->taa_render_sample += 1;
411  effects->taa_current_sample += 1;
412  }
413  else {
414  if (!DRW_state_is_playback() &&
415  ((effects->taa_total_sample == 0) ||
416  (effects->taa_current_sample < effects->taa_total_sample))) {
418  }
419  }
420 
421  DRW_view_persmat_get(NULL, effects->prev_drw_persmat, false);
422  }
423 }
typedef float(TangentPoint)[2]
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
#define BLI_assert(a)
Definition: BLI_assert.h:46
MINLINE int min_ii(int a, int b)
MINLINE uint divide_ceil_u(uint a, uint b)
MINLINE int max_ii(int a, int b)
#define M_PI
Definition: BLI_math_base.h:20
void window_translate_m4(float winmat[4][4], float perspmat[4][4], float x, float y)
Definition: math_geom.c:4587
void mul_project_m4_v3(const float M[4][4], float vec[3])
Definition: math_matrix.c:820
bool compare_m4m4(const float mat1[4][4], const float mat2[4][4], float limit)
Definition: math_matrix.c:1425
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
Random number functions.
void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r)
Definition: rand.cc:298
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED_FUNCTION(x)
#define UNUSED(x)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ SCE_EEVEE_TAA_REPROJECTION
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:303
#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
bScreen * ED_screen_animation_no_scrub(const struct wmWindowManager *wm)
NSNotificationCenter * center
struct GPUFrameBuffer GPUFrameBuffer
@ GPU_DEPTH_BIT
@ GPU_COLOR_BIT
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
_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 width
_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 t
struct GPUShader GPUShader
Definition: GPU_shader.h:20
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
#define cosf(x)
Definition: cuda/compat.h:101
Scene scene
GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition: draw_cache.c:356
bool DRW_state_is_opengl_render(void)
bool DRW_state_is_playback(void)
bool DRW_state_is_navigating(void)
bool DRW_state_draw_support(void)
const DRWContextState * DRW_context_state_get(void)
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:288
bool DRW_state_is_image_render(void)
bool DRW_state_is_scene_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)
const DRWView * DRW_view_default_get(void)
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_view_clip_planes_set(DRWView *view, float(*planes)[4], int plane_len)
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_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
void DRW_view_set_active(const DRWView *view)
int EEVEE_depth_of_field_sample_count_get(EEVEE_EffectsInfo *effects, int sample_count, int *r_ring_count)
bool EEVEE_depth_of_field_jitter_get(EEVEE_EffectsInfo *fx, float r_jitter[2], float *r_focus_distance)
#define TAA_MAX_SAMPLE
Definition: eevee_private.h:44
struct GPUShader * EEVEE_shaders_taa_resolve_sh_get(EEVEE_EffectsFlag enabled_effects)
@ EFFECT_TAA_REPROJECT
@ EFFECT_DOUBLE_BUFFER
@ EFFECT_VELOCITY_BUFFER
@ EFFECT_DEPTH_DOUBLE_BUFFER
@ EFFECT_POST_BUFFER
@ EFFECT_TAA
#define SWAP_BUFFERS_TAA()
bool EEVEE_renderpasses_only_first_sample_pass_active(EEVEE_Data *vedata)
static void eevee_create_cdf_table_temporal_sampling(void)
void EEVEE_temporal_sampling_offset_calc(const double ht_point[2], const float filter_size, float r_offset[2])
static float filter_blackman_harris(float x)
#define FILTER_CDF_TABLE_SIZE
void EEVEE_temporal_sampling_matrices_calc(EEVEE_EffectsInfo *effects, const double ht_point[2])
static void compute_cdf(float(*func)(float x), float cdf[FILTER_CDF_TABLE_SIZE])
void EEVEE_temporal_sampling_reset(EEVEE_Data *vedata)
static struct @214 e_data
static float eval_table(const float *table, float x)
int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
int EEVEE_temporal_sampling_sample_count_get(const Scene *scene, const EEVEE_StorageList *stl)
static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE], float invert_cdf[FILTER_CDF_TABLE_SIZE])
void EEVEE_temporal_sampling_draw(EEVEE_Data *vedata)
bool inited
void EEVEE_temporal_sampling_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
void EEVEE_temporal_sampling_create_view(EEVEE_Data *vedata)
void EEVEE_temporal_sampling_update_matrices(EEVEE_Data *vedata)
static float UNUSED_FUNCTION() filter_box(float UNUSED(x))
float inverted_cdf[FILTER_CDF_TABLE_SIZE]
void GPU_framebuffer_blit(GPUFrameBuffer *gpufb_read, int read_slot, GPUFrameBuffer *gpufb_write, int write_slot, eGPUFrameBufferBits blit_buffers)
ccl_gpu_kernel_postfix ccl_global float int int int int sh
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
struct Scene * scene
Definition: DRW_render.h:979
const struct bContext * evil_C
Definition: DRW_render.h:997
struct Depsgraph * depsgraph
Definition: DRW_render.h:987
struct GPUTexture * depth
EEVEE_TextureList * txl
EEVEE_StorageList * stl
EEVEE_PassList * psl
EEVEE_FramebufferList * fbl
struct GPUTexture * source_buffer
float prev_drw_persmat[4][4]
struct GPUFrameBuffer * target_buffer
EEVEE_EffectsFlag enabled_effects
struct DRWView * taa_view
struct GPUFrameBuffer * main_fb
struct GPUFrameBuffer * taa_history_color_fb
struct GPUFrameBuffer * double_buffer_depth_fb
struct GPUFrameBuffer * main_color_fb
struct GPUFrameBuffer * effect_color_fb
struct DRWPass * taa_resolve
struct EEVEE_PrivateData * g_data
struct EEVEE_EffectsInfo * effects
struct GPUTexture * taa_history
struct GPUUniformBuf * combined
struct EEVEE_ViewLayerData::@210 renderpass_ubo
struct GPUUniformBuf * common_ubo
struct RenderData r
struct SceneEEVEE eevee