Index: source/blender/nodes/intern/CMP_nodes/CMP_defocus.c =================================================================== --- source/blender/nodes/intern/CMP_nodes/CMP_defocus.c (revision 32424) +++ source/blender/nodes/intern/CMP_nodes/CMP_defocus.c (working copy) @@ -280,8 +280,11 @@ // CoC radius buffer crad = alloc_compbuf(img->x, img->y, CB_VAL, 1); + // additional scale for crad buffer for screen size awareness. + int screenWidth = img->x; + const float radDivider = 1024.0f; // if 'no_zbuf' flag set (which is always set if input is not an image), - // values are instead interpreted directly as blur radius values + // values are instead interpreted directly as blur radius values if (no_zbuf) { // to prevent *reaaallly* big radius values and impossible calculation times, // limit the maximum to half the image width or height, whichever is smaller @@ -289,7 +292,8 @@ unsigned int p; 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) * screenWidth; // bug #5921, limit minimum crad->rect[p] = MAX2(1e-5f, crad->rect[p]); crad->rect[p] = MIN2(crad->rect[p], maxr); @@ -299,7 +303,6 @@ } else { float wt; - // actual zbuffer. // separate foreground from background CoC's // then blur background and blend in again with foreground, @@ -312,7 +315,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) * screenWidth; if (crad->rect[px] <= 0.f) { wts->rect[px] = 1.f; crad->rect[px] = -crad->rect[px];