Bugfix #4683
Render non-osa, with mblur, did not jitter the zbuffering, so it did not result in basic AA for non moving parts. Note to self: this now works on < 2.42 level again: it doesn't use the correct subsampling, which can cause slight errors in rendering image textures.
This commit is contained in:
@@ -90,12 +90,12 @@ static void init_render_jit(Render *re)
|
||||
static float jit[32][2]; /* simple caching */
|
||||
static int lastjit= 0;
|
||||
|
||||
if(lastjit!=re->osa) {
|
||||
if(lastjit!=re->r.osa) {
|
||||
memset(jit, 0, sizeof(jit));
|
||||
BLI_initjit(jit[0], re->osa);
|
||||
BLI_initjit(jit[0], re->r.osa);
|
||||
}
|
||||
|
||||
lastjit= re->osa;
|
||||
lastjit= re->r.osa;
|
||||
memcpy(re->jit, jit, sizeof(jit));
|
||||
}
|
||||
|
||||
@@ -272,6 +272,8 @@ void make_sample_tables(Render *re)
|
||||
|
||||
free_sample_tables(re);
|
||||
|
||||
init_render_jit(re); /* needed for mblur too */
|
||||
|
||||
if(re->osa==0) {
|
||||
/* just prevents cpu cycles for larger render and copying */
|
||||
re->r.filtertype= 0;
|
||||
@@ -284,8 +286,6 @@ void make_sample_tables(Render *re)
|
||||
re->do_gamma= 1;
|
||||
}
|
||||
|
||||
init_render_jit(re);
|
||||
|
||||
st= re->samples= MEM_callocN(sizeof(SampleTables), "sample tables");
|
||||
|
||||
for(a=0; a<9;a++) {
|
||||
|
||||
@@ -1632,6 +1632,10 @@ void zbuffer_solid(RenderPart *pa, unsigned int lay, short layflag)
|
||||
zspan.zofsx= -pa->disprect.xmin - R.jit[pa->sample][0];
|
||||
zspan.zofsy= -pa->disprect.ymin - R.jit[pa->sample][1];
|
||||
}
|
||||
else if(R.i.curblur) {
|
||||
zspan.zofsx= -pa->disprect.xmin - R.jit[R.i.curblur-1][0];
|
||||
zspan.zofsy= -pa->disprect.ymin - R.jit[R.i.curblur-1][1];
|
||||
}
|
||||
else {
|
||||
zspan.zofsx= -pa->disprect.xmin;
|
||||
zspan.zofsy= -pa->disprect.ymin;
|
||||
@@ -2429,6 +2433,10 @@ static void zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase, u
|
||||
zspan.zofsx= -pa->disprect.xmin-R.jit[zsample][0];
|
||||
zspan.zofsy= -pa->disprect.ymin-R.jit[zsample][1];
|
||||
}
|
||||
else if(R.i.curblur) {
|
||||
zspan.zofsx= -pa->disprect.xmin - R.jit[R.i.curblur-1][0];
|
||||
zspan.zofsy= -pa->disprect.ymin - R.jit[R.i.curblur-1][1];
|
||||
}
|
||||
|
||||
for(v=0; v<R.totvlak; v++) {
|
||||
if((v & 255)==0)
|
||||
|
||||
Reference in New Issue
Block a user