fixed OSA and tile rendering problems
This commit is contained in:
@@ -901,28 +901,34 @@ static void addps(ListBase *lb, intptr_t *rd, int obi, int facenr, int z, int ma
|
||||
ps->shadfac= 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void freestyle_enhance_add(RenderPart *pa, float *rectf)
|
||||
static void freestyle_enhance_add(RenderPart *pa, RenderLayer *rl)
|
||||
{
|
||||
int x, y;
|
||||
float* freestyle;
|
||||
|
||||
RenderLayer* rl= render_get_active_layer( R.freestyle_render, R.freestyle_render->result );
|
||||
if( rl->rectf == NULL)
|
||||
return;
|
||||
|
||||
|
||||
for( x = pa->disprect.xmin + pa->crop; x < pa->disprect.xmax - pa->crop; x++) {
|
||||
for( y = pa->disprect.ymin + pa->crop; y < pa->disprect.ymax - pa->crop; y++) {
|
||||
|
||||
freestyle = rl->rectf + 4 * (R.recty * x + y);
|
||||
if( freestyle[3] > 0.0)
|
||||
addAlphaOverFloat(rectf, freestyle);
|
||||
rectf += 4;
|
||||
|
||||
}
|
||||
}
|
||||
RenderLayer *freestyle_rl;
|
||||
RenderLayer *rlpp[RE_MAX_OSA];
|
||||
int totsample;
|
||||
int x, y, od;
|
||||
float* freestyle;
|
||||
|
||||
freestyle_rl = render_get_active_layer( R.freestyle_render, R.freestyle_render->result );
|
||||
if( freestyle_rl->rectf == NULL)
|
||||
return;
|
||||
|
||||
totsample= get_sample_layers(pa, rl, rlpp);
|
||||
od = 0;
|
||||
|
||||
for( y = pa->disprect.ymin; y < pa->disprect.ymax; y++) {
|
||||
for( x = pa->disprect.xmin; x < pa->disprect.xmax; x++, od++) {
|
||||
int sample;
|
||||
|
||||
freestyle = freestyle_rl->rectf + 4 * (R.rectx * y + x);
|
||||
if( freestyle[3] > 0.0) {
|
||||
for( sample = 0; sample < totsample; sample++) {
|
||||
float *rgbrect = rlpp[sample]->rectf + 4*od;
|
||||
addAlphaOverFloat(rgbrect, freestyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void edge_enhance_add(RenderPart *pa, float *rectf, float *arect)
|
||||
@@ -1245,7 +1251,7 @@ void zbufshadeDA_tile(RenderPart *pa)
|
||||
|
||||
if(rl->layflag & SCE_LAY_FRS)
|
||||
if(R.r.mode & R_EDGE_FRS)
|
||||
freestyle_enhance_add(pa, rl->rectf);
|
||||
freestyle_enhance_add(pa, rl);
|
||||
|
||||
if(rl->passflag & SCE_PASS_VECTOR)
|
||||
reset_sky_speed(pa, rl);
|
||||
@@ -1413,7 +1419,7 @@ void zbufshade_tile(RenderPart *pa)
|
||||
|
||||
if(rl->layflag & SCE_LAY_FRS)
|
||||
if(R.r.mode & R_EDGE_FRS)
|
||||
freestyle_enhance_add(pa, rl->rectf);
|
||||
freestyle_enhance_add(pa, rl);
|
||||
|
||||
if(rl->passflag & SCE_PASS_VECTOR)
|
||||
reset_sky_speed(pa, rl);
|
||||
|
||||
Reference in New Issue
Block a user