forked from bartvdbraak/blender
Fix for bug #10990: edge render AA issue.
This commit is contained in:
parent
fa9b01908f
commit
529a8bb949
@ -849,7 +849,7 @@ static void convert_to_key_alpha(RenderPart *pa, float *rectf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* adds only alpha values */
|
/* adds only alpha values */
|
||||||
void edge_enhance_tile(RenderPart *pa, float *rectf)
|
void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
|
||||||
{
|
{
|
||||||
/* use zbuffer to define edges, add it to the image */
|
/* use zbuffer to define edges, add it to the image */
|
||||||
int y, x, col, *rz, *rz1, *rz2, *rz3;
|
int y, x, col, *rz, *rz1, *rz2, *rz3;
|
||||||
@ -857,13 +857,13 @@ void edge_enhance_tile(RenderPart *pa, float *rectf)
|
|||||||
float *rf;
|
float *rf;
|
||||||
|
|
||||||
/* shift values in zbuffer 4 to the right (anti overflows), for filter we need multiplying with 12 max */
|
/* shift values in zbuffer 4 to the right (anti overflows), for filter we need multiplying with 12 max */
|
||||||
rz= pa->rectz;
|
rz= rectz;
|
||||||
if(rz==NULL) return;
|
if(rz==NULL) return;
|
||||||
|
|
||||||
for(y=0; y<pa->recty; y++)
|
for(y=0; y<pa->recty; y++)
|
||||||
for(x=0; x<pa->rectx; x++, rz++) (*rz)>>= 4;
|
for(x=0; x<pa->rectx; x++, rz++) (*rz)>>= 4;
|
||||||
|
|
||||||
rz1= pa->rectz;
|
rz1= rectz;
|
||||||
rz2= rz1+pa->rectx;
|
rz2= rz1+pa->rectx;
|
||||||
rz3= rz2+pa->rectx;
|
rz3= rz2+pa->rectx;
|
||||||
|
|
||||||
@ -903,7 +903,7 @@ void edge_enhance_tile(RenderPart *pa, float *rectf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* shift back zbuf values, we might need it still */
|
/* shift back zbuf values, we might need it still */
|
||||||
rz= pa->rectz;
|
rz= rectz;
|
||||||
for(y=0; y<pa->recty; y++)
|
for(y=0; y<pa->recty; y++)
|
||||||
for(x=0; x<pa->rectx; x++, rz++) (*rz)<<= 4;
|
for(x=0; x<pa->rectx; x++, rz++) (*rz)<<= 4;
|
||||||
|
|
||||||
@ -1012,7 +1012,7 @@ void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data)
|
|||||||
|
|
||||||
if(sdata->rl->layflag & SCE_LAY_EDGE)
|
if(sdata->rl->layflag & SCE_LAY_EDGE)
|
||||||
if(R.r.mode & R_EDGE)
|
if(R.r.mode & R_EDGE)
|
||||||
edge_enhance_tile(pa, sdata->edgerect);
|
edge_enhance_tile(pa, sdata->edgerect, zspan->rectz);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main call for shading Delta Accum, for OSA */
|
/* main call for shading Delta Accum, for OSA */
|
||||||
@ -1189,7 +1189,7 @@ void zbufshade_tile(RenderPart *pa)
|
|||||||
if(rl->layflag & SCE_LAY_EDGE) {
|
if(rl->layflag & SCE_LAY_EDGE) {
|
||||||
if(R.r.mode & R_EDGE) {
|
if(R.r.mode & R_EDGE) {
|
||||||
edgerect= MEM_callocN(sizeof(float)*pa->rectx*pa->recty, "rectedge");
|
edgerect= MEM_callocN(sizeof(float)*pa->rectx*pa->recty, "rectedge");
|
||||||
edge_enhance_tile(pa, edgerect);
|
edge_enhance_tile(pa, edgerect, pa->rectz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user