Blender V4.3
eevee_motion_blur.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
43#pragma once
44
45#include "BLI_map.hh"
47
48#include "eevee_sampling.hh"
50#include "eevee_velocity.hh"
51
52namespace blender::eevee {
53
54/* -------------------------------------------------------------------- */
64 private:
65 Instance &inst_;
66
71 Vector<float> time_steps_;
72
74 int initial_frame_;
75 float initial_subframe_;
77 float frame_time_;
79 int shutter_position_;
81 float shutter_time_;
82
84 bool enabled_ = false;
86 bool motion_blur_fx_enabled_ = false;
88 bool was_navigating_ = false;
89
90 int step_id_ = 0;
91
93 TextureFromPool tiles_tx_;
94
95 GPUTexture *input_color_tx_ = nullptr;
96 GPUTexture *output_color_tx_ = nullptr;
97
98 PassSimple motion_blur_ps_ = {"MotionBlur"};
99
100 MotionBlurTileIndirectionBuf tile_indirection_buf_;
101 MotionBlurDataBuf data_;
103 int3 dispatch_flatten_size_ = int3(0);
104 int3 dispatch_dilate_size_ = int3(0);
105 int3 dispatch_gather_size_ = int3(0);
106
107 public:
108 MotionBlurModule(Instance &inst) : inst_(inst){};
110
111 void init();
112
113 void step();
114
115 void sync();
116
117 bool postfx_enabled() const
118 {
119 return motion_blur_fx_enabled_;
120 }
121
122 void render(View &view, GPUTexture **input_tx, GPUTexture **output_tx);
123
124 private:
125 float shutter_time_to_scene_time(float time);
126};
127
130} // namespace blender::eevee
A running instance of the engine.
VecBase< int32_t, 3 > int3