New ("fullframe") CPU compositor backend is being used now, and all the code
related to "tiled" CPU compositor is just never used anymore. The new backend
is faster, uses less memory, better matches GPU compositor, etc.
TL;DR: 20 thousand lines of code gone.
This commit:
- Removes various bits and pieces related to "tiled" compositor (execution
groups, one-pixel-at-a-time node processing, read/write buffer operations
related to node execution groups).
- "GPU" (OpenCL) execution device, that was only used by several nodes of
the tiled compositor.
- With that, remove CLEW external library too, since nothing within Blender
uses OpenCL directly anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/118819
96 lines
2.8 KiB
C++
96 lines
2.8 KiB
C++
/* SPDX-FileCopyrightText: 2013 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "COM_PlaneTrackOperation.h"
|
|
|
|
#include "DNA_defaults.h"
|
|
|
|
#include "BKE_movieclip.h"
|
|
#include "BKE_tracking.h"
|
|
|
|
namespace blender::compositor {
|
|
|
|
/* ******** PlaneTrackCommon ******** */
|
|
|
|
PlaneTrackCommon::PlaneTrackCommon()
|
|
{
|
|
movie_clip_ = nullptr;
|
|
framenumber_ = 0;
|
|
tracking_object_name_[0] = '\0';
|
|
plane_track_name_[0] = '\0';
|
|
}
|
|
|
|
void PlaneTrackCommon::read_and_calculate_corners(PlaneDistortBaseOperation *distort_op)
|
|
{
|
|
float corners[4][2];
|
|
if (distort_op->motion_blur_samples_ == 1) {
|
|
read_corners_from_track(corners, framenumber_);
|
|
distort_op->calculate_corners(corners, true, 0);
|
|
}
|
|
else {
|
|
const float frame = float(framenumber_) - distort_op->motion_blur_shutter_;
|
|
const float frame_step = (distort_op->motion_blur_shutter_ * 2.0f) /
|
|
distort_op->motion_blur_samples_;
|
|
float frame_iter = frame;
|
|
for (int sample = 0; sample < distort_op->motion_blur_samples_; sample++) {
|
|
read_corners_from_track(corners, frame_iter);
|
|
distort_op->calculate_corners(corners, true, sample);
|
|
frame_iter += frame_step;
|
|
}
|
|
}
|
|
}
|
|
|
|
void PlaneTrackCommon::read_corners_from_track(float corners[4][2], float frame)
|
|
{
|
|
if (!movie_clip_) {
|
|
return;
|
|
}
|
|
|
|
MovieTracking *tracking = &movie_clip_->tracking;
|
|
|
|
MovieTrackingObject *tracking_object = BKE_tracking_object_get_named(tracking,
|
|
tracking_object_name_);
|
|
if (tracking_object) {
|
|
MovieTrackingPlaneTrack *plane_track;
|
|
plane_track = BKE_tracking_object_find_plane_track_with_name(tracking_object,
|
|
plane_track_name_);
|
|
if (plane_track) {
|
|
float clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(movie_clip_, frame);
|
|
BKE_tracking_plane_marker_get_subframe_corners(plane_track, clip_framenr, corners);
|
|
}
|
|
}
|
|
}
|
|
|
|
void PlaneTrackCommon::determine_canvas(const rcti &preferred_area, rcti &r_area)
|
|
{
|
|
r_area = COM_AREA_NONE;
|
|
if (movie_clip_) {
|
|
int width, height;
|
|
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
|
|
BKE_movieclip_user_set_frame(&user, framenumber_);
|
|
BKE_movieclip_get_size(movie_clip_, &user, &width, &height);
|
|
r_area = preferred_area;
|
|
r_area.xmax = r_area.xmin + width;
|
|
r_area.ymax = r_area.ymin + height;
|
|
}
|
|
}
|
|
|
|
/* ******** PlaneTrackMaskOperation ******** */
|
|
|
|
void PlaneTrackMaskOperation::init_data()
|
|
{
|
|
PlaneDistortMaskOperation::init_data();
|
|
PlaneTrackCommon::read_and_calculate_corners(this);
|
|
}
|
|
|
|
/* ******** PlaneTrackWarpImageOperation ******** */
|
|
|
|
void PlaneTrackWarpImageOperation::init_data()
|
|
{
|
|
PlaneDistortWarpImageOperation::init_data();
|
|
PlaneTrackCommon::read_and_calculate_corners(this);
|
|
}
|
|
|
|
} // namespace blender::compositor
|