diff options
author | Habib Gahbiche <habibgahbiche@gmail.com> | 2022-02-21 01:15:39 +0300 |
---|---|---|
committer | Habib Gahbiche <habibgahbiche@gmail.com> | 2022-02-21 01:15:39 +0300 |
commit | 36d7adf85c5839318e5a6148b75b637fd7b989f8 (patch) | |
tree | 9b6f1a7ef6b610aeda34f7e03af48917ac08b148 | |
parent | 1f7913228779d7ae20a57ffe1dfdfa6465f9972d (diff) | |
parent | 1a0a22f95a22496dec2791441249265d553dc2d7 (diff) |
Merge branch 'blender-v3.1-release'
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc index 1b23b0e001c..c19dee921a4 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc @@ -29,8 +29,10 @@ void GaussianBokehBlurOperation::init_data() const float width = this->get_width(); const float height = this->get_height(); - if (!sizeavailable_) { - update_size(); + if(execution_model_ == eExecutionModel::FullFrame) { + if (!sizeavailable_) { + update_size(); + } } radxf_ = size_ * (float)data_.sizex; @@ -96,6 +98,22 @@ void GaussianBokehBlurOperation::update_gauss() void GaussianBokehBlurOperation::execute_pixel(float output[4], int x, int y, void *data) { + float result[4]; + input_size_->read_sampled(result, 0, 0, PixelSampler::Nearest); + size_ = result[0]; + + const float width = this->get_width(); + const float height = this->get_height(); + + radxf_ = size_ * (float)data_.sizex; + CLAMP(radxf_, 0.0f, width / 2.0f); + + radyf_ = size_ * (float)data_.sizey; + CLAMP(radyf_, 0.0f, height / 2.0f); + + radx_ = ceil(radxf_); + rady_ = ceil(radyf_); + float temp_color[4]; temp_color[0] = 0; temp_color[1] = 0; |