From 597e6f9bbc7bf08150e81356f734b33c5e05ce68 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 15 Aug 2012 18:14:34 +0000 Subject: Fix for * [#32323] regression: Dispertion artifacts with smaller chunksizes * [#32125] "Projector" Dispersion not working with ChunkSize < 256 --- .../operations/COM_ProjectorLensDistortionOperation.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp') diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp index 7e854f01213..d92fe04eb15 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp @@ -80,12 +80,20 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in newInput.xmax = input->xmax + this->m_kr2 + 2; } else { + rcti dispInput; + BLI_rcti_init(&dispInput, 0,5,0,5); + if (this->getInputOperation(1)->determineDependingAreaOfInterest(&dispInput, readOperation, output)) { + return true; + } newInput.xmin = input->xmin - 7; /* (0.25f * 20 * 1) + 2 == worse case dispersion */ newInput.ymin = input->ymin; newInput.ymax = input->ymax; newInput.xmax = input->xmax + 7; /* (0.25f * 20 * 1) + 2 == worse case dispersion */ } - return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); + if (this->getInputOperation(0)->determineDependingAreaOfInterest(&newInput, readOperation, output)) { + return true; + } + return false; } void ProjectorLensDistortionOperation::updateDispersion() @@ -94,7 +102,7 @@ void ProjectorLensDistortionOperation::updateDispersion() this->lockMutex(); if (!this->m_dispersionAvailable) { float result[4]; - this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST); + this->getInputSocketReader(1)->read(result, 1, 1, COM_PS_NEAREST); this->m_dispersion = result[0]; this->m_kr = 0.25f * maxf(minf(this->m_dispersion, 1.0f), 0.0f); this->m_kr2 = this->m_kr * 20; -- cgit v1.2.3