Files
test2/source/blender/compositor/nodes/COM_VectorBlurNode.cc
Omar Emara b229d32086 Compositor: Port GPU Vector Blur to CPU
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
2024-04-05 09:48:03 +02:00

32 lines
1.1 KiB
C++

/* SPDX-FileCopyrightText: 2011 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "COM_VectorBlurNode.h"
#include "COM_VectorBlurOperation.h"
namespace blender::compositor {
VectorBlurNode::VectorBlurNode(bNode *editor_node) : Node(editor_node)
{
/* pass */
}
void VectorBlurNode::convert_to_operations(NodeConverter &converter,
const CompositorContext & /*context*/) const
{
const bNode *node = this->get_bnode();
const NodeBlurData *vector_blur_settings = (const NodeBlurData *)node->storage;
VectorBlurOperation *operation = new VectorBlurOperation();
operation->set_vector_blur_settings(vector_blur_settings);
converter.add_operation(operation);
converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0));
converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1));
converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2));
converter.map_output_socket(get_output_socket(), operation->get_output_socket());
}
} // namespace blender::compositor