diff options
author | Ton Roosendaal <ton@blender.org> | 2005-03-25 00:01:12 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-03-25 00:01:12 +0300 |
commit | 9e90f1407e5cc4b10b3a0e249674ceefc156c30b (patch) | |
tree | 442b90e201b5ab9bff39ee647638f8fdd211f02b /source/blender/render/intern | |
parent | 76f23460805018535a6b2d9b0ab8a25f9b2074dd (diff) |
Bug fix 2303
The gamma functions in gammaCorrectionTables.c cannot be used to correct
and correct back with identical results... causing banding in rendering
pictures with halos.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/gammaCorrectionTables.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/render/intern/source/gammaCorrectionTables.c b/source/blender/render/intern/source/gammaCorrectionTables.c index 0e27aacd9e3..9273aa899ee 100644 --- a/source/blender/render/intern/source/gammaCorrectionTables.c +++ b/source/blender/render/intern/source/gammaCorrectionTables.c @@ -40,8 +40,8 @@ #include <config.h> #endif -/* There are two parts here: one for the old renderer, one for the unified */ -/* renderer. we start with the latter. */ +/* WARNING; optimized, cannot be used to do gamma(invgamma()) and expect */ +/* result remain identical (ton) */ /* Default gamma. For most CRTs, gamma ranges from 2.2 to 2.5 (Foley), so */ /* 2.35 seems appropriate enough. Experience teaches a different number */ diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 75f106be7ab..e73c1a63413 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -451,9 +451,9 @@ static void scanlinehaloPS(int *rectz, long *rectdelta, float *rowbuf, short ys) float *buf= rowbuf; int xt; for(xt=0; xt<R.rectx; xt++, buf+=4) { - buf[0]= invGammaCorrect(buf[0]); - buf[1]= invGammaCorrect(buf[1]); - buf[2]= invGammaCorrect(buf[2]); + buf[0]= sqrt(buf[0]); // invers gamma 2.0 + buf[1]= sqrt(buf[1]); + buf[2]= sqrt(buf[2]); } didgamma= 1; } @@ -526,9 +526,9 @@ static void scanlinehaloPS(int *rectz, long *rectdelta, float *rowbuf, short ys) float *buf= rowbuf; int xt; for(xt=0; xt<R.rectx; xt++, buf+=4) { - buf[0]= gammaCorrect(buf[0]); - buf[1]= gammaCorrect(buf[1]); - buf[2]= gammaCorrect(buf[2]); + buf[0]*= (buf[0]); // gamma 2.0 + buf[1]*= (buf[1]); + buf[2]*= (buf[2]); } } |