Unified renderer OSA sample clipping:
User info: This change limits the contribution of any OSA sample to 1.0 per color in the Unified renderer. Because color=1.0 gives fully saturated color, samples contributing more than 1.0 were overweighted in the OSA average causing aliasing (sometimes quite severe). Samples can contribute more than 1.0 because a material's spec and refl values are not normalized (In real world spec+refl <= 1.0). This solves a large class of aliasing problems in the unified renderer. Coder Info: None.
This commit is contained in:
@@ -618,9 +618,9 @@ void sampleFloatColV2FloatColV(float *sample, float *dest, int osaNr)
|
||||
if (doGamma()) {
|
||||
/* use a LUT and interpolation to do the gamma correction */
|
||||
for(a=0; a < osaNr; a++, scol+=4) {
|
||||
intcol[0] += gammaCorrect(scol[0]);
|
||||
intcol[1] += gammaCorrect(scol[1]);
|
||||
intcol[2] += gammaCorrect(scol[2]);
|
||||
intcol[0] += gammaCorrect( (scol[0]<1.0) ? scol[0]:1.0 );
|
||||
intcol[1] += gammaCorrect( (scol[1]<1.0) ? scol[1]:1.0 );
|
||||
intcol[2] += gammaCorrect( (scol[2]<1.0) ? scol[2]:1.0 );
|
||||
intcol[3] += scol[3];
|
||||
}
|
||||
|
||||
@@ -638,8 +638,10 @@ void sampleFloatColV2FloatColV(float *sample, float *dest, int osaNr)
|
||||
} else {
|
||||
/* no gamma */
|
||||
for(a=0; a < osaNr; a++, scol+=4) {
|
||||
intcol[0] += scol[0]; intcol[1] += scol[1];
|
||||
intcol[2] += scol[2]; intcol[3] += scol[3];
|
||||
intcol[0] += (scol[0]<1.0) ? scol[0]:1.0 ;
|
||||
intcol[1] += (scol[1]<1.0) ? scol[1]:1.0 ;
|
||||
intcol[2] += (scol[2]<1.0) ? scol[2]:1.0 ;
|
||||
intcol[3] += scol[3];
|
||||
}
|
||||
|
||||
dest[0]= intcol[0]/osaNr;
|
||||
|
||||
Reference in New Issue
Block a user