Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo de Greef <eeshlo@yahoo.com>2007-04-29 05:59:19 +0400
committerAlfredo de Greef <eeshlo@yahoo.com>2007-04-29 05:59:19 +0400
commit3863205d6132d88e669d94e3cff7a3853c146caa (patch)
tree3d6823e970f6409bc48ad77a35fcc02b29fe66a5 /source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
parent5a3b6f36e3c7d087d0339b6f44ded801c9ce5220 (diff)
bug #6615, not complete solution, but slightly improves the result at least.
Additionally fixed another bug, never reported, but a zero bokeh rotation offset seemed to cause missing center lines.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_defocus.c')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_defocus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
index db663c38215..997769ceb63 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
@@ -54,7 +54,8 @@ typedef struct BokehCoeffs {
// BKH[8] is the data returned for the bokeh shape & bkh_b[4] is it's 2d bound
static void makeBokeh(char bktype, char ro, int* len_bkh, float* inradsq, BokehCoeffs BKH[8], float bkh_b[4])
{
- float x0, x1, y0, y1, dx, dy, iDxy, w = ro*M_PI/180.f;
+ float x0, x1, y0, y1, dx, dy, iDxy;
+ float w = MAX2(1e-5f, ro)*M_PI/180.f; // never reported stangely enough, but a zero offset causes missing center line...
float wi = (360.f/bktype)*M_PI/180.f;
int i, ov, nv;
@@ -337,7 +338,8 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
bcrad = 0.5f*fabs(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f));
// scale crad back to original maximum and blend
crad->rect[px] = bcrad + wts->rect[px]*(scf*crad->rect[px] - bcrad);
- if (crad->rect[px] < 0.01f) crad->rect[px] = 0.01f;
+ // 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates the problem
+ crad->rect[px] = MAX2(crad->rect[px], 0.5f);
// if maxblur!=0, limit maximum
if (nqd->maxblur != 0.f) crad->rect[px] = MIN2(crad->rect[px], nqd->maxblur);
}