Bugfix #17497
FSA didn't support "key alpha", fixed it. Also noticed edge-enhance didnt work for FSA, added warning for that, fixing it is too clumsy, this option belongs in compositor.
This commit is contained in:
@@ -2346,6 +2346,12 @@ static int is_rendering_allowed(Render *re)
|
||||
if(re->osa==0)
|
||||
re->r.scemode &= ~R_FULL_SAMPLE;
|
||||
|
||||
/* no fullsample and edge */
|
||||
if((re->r.scemode & R_FULL_SAMPLE) && (re->r.mode & R_EDGE)) {
|
||||
re->error("Full Sample doesn't support Edge Enhance");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
|
||||
|
||||
@@ -931,17 +931,23 @@ static void edge_enhance_add(RenderPart *pa, float *rectf, float *arect)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void convert_to_key_alpha(RenderPart *pa, float *rectf)
|
||||
static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl)
|
||||
{
|
||||
int y;
|
||||
RenderLayer *rlpp[RE_MAX_OSA];
|
||||
int y, sample, totsample;
|
||||
|
||||
for(y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
|
||||
if(rectf[3] >= 1.0f);
|
||||
else if(rectf[3] > 0.0f) {
|
||||
rectf[0] /= rectf[3];
|
||||
rectf[1] /= rectf[3];
|
||||
rectf[2] /= rectf[3];
|
||||
totsample= get_sample_layers(pa, rl, rlpp);
|
||||
|
||||
for(sample= 0; sample<totsample; sample++) {
|
||||
float *rectf= rlpp[sample]->rectf;
|
||||
|
||||
for(y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
|
||||
if(rectf[3] >= 1.0f);
|
||||
else if(rectf[3] > 0.0f) {
|
||||
rectf[0] /= rectf[3];
|
||||
rectf[1] /= rectf[3];
|
||||
rectf[2] /= rectf[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1229,7 +1235,7 @@ void zbufshadeDA_tile(RenderPart *pa)
|
||||
|
||||
/* de-premul alpha */
|
||||
if(R.r.alphamode & R_ALPHAKEY)
|
||||
convert_to_key_alpha(pa, rl->rectf);
|
||||
convert_to_key_alpha(pa, rl);
|
||||
|
||||
/* free stuff within loop! */
|
||||
MEM_freeN(pa->rectdaps); pa->rectdaps= NULL;
|
||||
@@ -1393,7 +1399,7 @@ void zbufshade_tile(RenderPart *pa)
|
||||
|
||||
/* de-premul alpha */
|
||||
if(R.r.alphamode & R_ALPHAKEY)
|
||||
convert_to_key_alpha(pa, rl->rectf);
|
||||
convert_to_key_alpha(pa, rl);
|
||||
|
||||
if(edgerect) MEM_freeN(edgerect);
|
||||
edgerect= NULL;
|
||||
|
||||
Reference in New Issue
Block a user