Index: source/blender/nodes/intern/CMP_nodes/CMP_defocus.c =================================================================== --- source/blender/nodes/intern/CMP_nodes/CMP_defocus.c (revision 32418) +++ source/blender/nodes/intern/CMP_nodes/CMP_defocus.c (working copy) @@ -287,9 +287,12 @@ // limit the maximum to half the image width or height, whichever is smaller float maxr = 0.5f*(float)MIN2(img->x, img->y); unsigned int p; + int screensize = img->x*img->y; + const float radDivider = (1024.0*768.0); for (p=0; p<(unsigned int)(img->x*img->y); p++) { - crad->rect[p] = zbuf ? (zbuf->rect[p]*nqd->scale) : inpval; + float rad = zbuf ? (zbuf->rect[p]*nqd->scale) : inpval; + crad->rect[p] = (rad/radDivider) * screensize; // bug #5921, limit minimum crad->rect[p] = MAX2(1e-5f, crad->rect[p]); crad->rect[p] = MIN2(crad->rect[p], maxr); @@ -299,7 +302,8 @@ } else { float wt; - + int screensize = img->x*img->y; + const float radDivider = (1024.0*768.0); // actual zbuffer. // separate foreground from background CoC's // then blur background and blend in again with foreground, @@ -312,7 +316,8 @@ for (x=0; xx; x++) { unsigned int px = p + x; float iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]); - crad->rect[px] = 0.5f*(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f)); + float rad = 0.5f*(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f)); + crad->rect[px] = (rad/radDivider) * screensize; if (crad->rect[px] <= 0.f) { wts->rect[px] = 1.f; crad->rect[px] = -crad->rect[px];