diff options
author | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-10-20 01:08:44 +0400 |
---|---|---|
committer | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-10-20 01:08:44 +0400 |
commit | 7ac2731e63e0102583238541ee9dd786b9ff3746 (patch) | |
tree | 21b1afe910c09718b6be9dbc1312547a159cc30f /source/blender/render/intern/source/pixelblending.c | |
parent | d5322a6352edf8c6f23af18024c5c9ebc83b0c6f (diff) |
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.
Diffstat (limited to 'source/blender/render/intern/source/pixelblending.c')
-rw-r--r-- | source/blender/render/intern/source/pixelblending.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c index 338e60e6be8..c1bd67c7479 100644 --- a/source/blender/render/intern/source/pixelblending.c +++ b/source/blender/render/intern/source/pixelblending.c @@ -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; |