This patch ports the GPU Vector Blur node to the CPU, which is in turn ported from EEVEE. This is a breaking change since it produces different motion blur results that are more similar to EEVEE's motion blur. Further, the Curved, Minimum, and Maximum options were removed on the user level since they are not used in the new implementation. There are no significant changes to the code, except in the max velocity computation as well as the velocity dilation passes. The GPU code uses atomic indirection buffers, while the CPU runs single threaded for the dilation pass, since it is a fast pass anyways. However, we impose artificial constraints on the precision of the dilation process for compatibility with the atomic implementation. There are still tiny differences between CPU and GPU that I haven't been able to solve, but I shall solve them in a later patch. Pull Request: https://projects.blender.org/blender/blender/pulls/120135
35 lines
877 B
C++
35 lines
877 B
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "COM_NodeOperation.h"
|
|
#include "DNA_node_types.h"
|
|
|
|
namespace blender::compositor {
|
|
|
|
class VectorBlurOperation : public NodeOperation {
|
|
private:
|
|
static constexpr int IMAGE_INPUT_INDEX = 0;
|
|
static constexpr int DEPTH_INPUT_INDEX = 1;
|
|
static constexpr int VELOCITY_INPUT_INDEX = 2;
|
|
|
|
const NodeBlurData *settings_;
|
|
|
|
public:
|
|
VectorBlurOperation();
|
|
|
|
void set_vector_blur_settings(const NodeBlurData *settings)
|
|
{
|
|
settings_ = settings;
|
|
}
|
|
|
|
void update_memory_buffer(MemoryBuffer *output,
|
|
const rcti &area,
|
|
Span<MemoryBuffer *> inputs) override;
|
|
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override;
|
|
};
|
|
|
|
} // namespace blender::compositor
|