change to variable size bokeh blue, dont blur larger areas then the current pixel defines.

caused nasty looking errors with DOF.
This commit is contained in:
Campbell Barton
2013-03-19 18:32:56 +00:00
parent aa40fcb0a7
commit 5c48eb3bb9
2 changed files with 2 additions and 2 deletions

View File

@@ -112,7 +112,7 @@ __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2
float dx = nx - realCoordinate.s0;
if (dx != 0 || dy != 0) {
inputCoordinate.s0 = nx - offsetInput.s0;
size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar;
size = min(read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar, size_center);
if (size > threshold) {
if (size >= fabs(dx) && size >= fabs(dy)) {
float2 uv = {256.0f + dx * 255.0f / size,

View File

@@ -146,7 +146,7 @@ void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y,
int offsetNxNy = offsetNy + (minx * COM_NUMBER_OF_CHANNELS);
for (int nx = minx; nx < maxx; nx += QualityStepHelper::getStep()) {
if (nx != x || ny != y) {
float size = inputSizeFloatBuffer[offsetNxNy] * scalar;
float size = min(inputSizeFloatBuffer[offsetNxNy] * scalar, size_center);
if (size > this->m_threshold) {
float dx = nx - x;
if (size > fabsf(dx) && size > fabsf(dy)) {