diff options
-rw-r--r-- | source/blender/render/intern/include/rendercore.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 33 | ||||
-rw-r--r-- | source/blender/render/intern/source/zbuf.c | 1 |
3 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 4c28959ceba..79b892564bf 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -52,7 +52,7 @@ struct ShadeResult; /* to make passing on variables to shadepixel() easier */ typedef struct ShadePixelInfo { int thread; - int passflag; + int layflag, passflag; unsigned int lay; ShadeResult shr; } ShadePixelInfo; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 11b15aa4491..65447aca4b4 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2628,23 +2628,26 @@ void *shadepixel(ShadePixelInfo *shpi, float x, float y, int z, volatile int fac } if(R.flag & R_LAMPHALO) { - if(facenr<=0) { /* calc view vector and put shi.co at far */ - if(R.r.mode & R_ORTHO) { - /* x and y 3d coordinate can be derived from pixel coord and winmat */ - float fx= 2.0/(R.rectx*R.winmat[0][0]); - float fy= 2.0/(R.recty*R.winmat[1][1]); + if(shpi->layflag & SCE_LAY_HALO) { + + if(facenr<=0) { /* calc view vector and put shi.co at far */ + if(R.r.mode & R_ORTHO) { + /* x and y 3d coordinate can be derived from pixel coord and winmat */ + float fx= 2.0/(R.rectx*R.winmat[0][0]); + float fy= 2.0/(R.recty*R.winmat[1][1]); + + shi.co[0]= (0.5 + x - 0.5*R.rectx)*fx - R.winmat[3][0]/R.winmat[0][0]; + shi.co[1]= (0.5 + y - 0.5*R.recty)*fy - R.winmat[3][1]/R.winmat[1][1]; + } + + calc_view_vector(shi.view, x, y); + shi.co[2]= 0.0; - shi.co[0]= (0.5 + x - 0.5*R.rectx)*fx - R.winmat[3][0]/R.winmat[0][0]; - shi.co[1]= (0.5 + y - 0.5*R.recty)*fy - R.winmat[3][1]/R.winmat[1][1]; + renderspothalo(&shi, shr->combined, 1.0); } - - calc_view_vector(shi.view, x, y); - shi.co[2]= 0.0; - - renderspothalo(&shi, shr->combined, 1.0); + else + renderspothalo(&shi, shr->combined, shr->combined[3]); } - else - renderspothalo(&shi, shr->combined, shr->combined[3]); } return vlr; @@ -2887,6 +2890,7 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl) /* fill shadepixel info struct */ shpi.thread= pa->thread; shpi.lay= rl->lay; + shpi.layflag= rl->layflag; shpi.passflag= 0; if(rl->passflag & ~(SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR|SCE_PASS_COMBINED)) @@ -3197,6 +3201,7 @@ void zbufshade_tile(RenderPart *pa) /* fill shadepixel info struct */ shpi.lay= rl->lay; + shpi.layflag= rl->layflag; shpi.passflag= 0; if(rl->passflag & ~(SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR|SCE_PASS_COMBINED)) diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 04807e3b2ba..b1e3a15bc95 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2637,6 +2637,7 @@ void zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pass) /* fill shadepixel info struct */ shpi.thread= pa->thread; shpi.lay= rl->lay; + shpi.layflag= rl->layflag; shpi.passflag= 0; if(rl->passflag & ~(SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR|SCE_PASS_COMBINED)) |