diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-08-15 22:14:34 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-08-15 22:14:34 +0400 |
commit | 597e6f9bbc7bf08150e81356f734b33c5e05ce68 (patch) | |
tree | ce19f257bfcfcca49e9b09f5fc7b8e20fdcc4406 /source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp | |
parent | 86a69c5028721f52c0001aed09544a83cf9f39e6 (diff) |
Fix for
* [#32323] regression: Dispertion artifacts with smaller chunksizes
* [#32125] "Projector" Dispersion not working with ChunkSize < 256
Diffstat (limited to 'source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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; |