Fix for Key alpha. Thanks to unifying code in render (unified and normal)

we cannot insert colored pixels in sky for Key alpha anymore. Well, this
was useless anyway! (BTW: error not in 2.36 release)
This commit is contained in:
Ton Roosendaal
2005-02-19 13:04:23 +00:00
parent 3f463dcc32
commit d028bcf452
2 changed files with 7 additions and 19 deletions

View File

@@ -192,9 +192,9 @@ static void init_filt_mask(void)
}
if(R.r.alphamode==R_ALPHAKEY) gamma= 1.0; /* gamma correction of alpha is nasty */
if(R.r.mode & R_GAMMA) gamma= 2.0;
else if(R.r.mode & R_GAMMA) gamma= 2.0;
else gamma= 1.0;
igamma= 1.0/gamma;
if(gamma!= lastgamma) {
@@ -879,7 +879,8 @@ static void renderloop_setblending(void)
/* this value should only be set here. do_gamma is for gammablended adding of subpixels */
do_gamma= 0;
if(R.r.mode & R_GAMMA) {
if((R.r.mode & R_OSA)) do_gamma= 1;
if(R.r.alphamode==R_ALPHAKEY); // alpha corrected gamma doesnt work for key alpha
else if((R.r.mode & R_OSA)) do_gamma= 1;
}
/* always call, it does gamma tables used by alphaunder, but call after R.osa and jit was set */

View File

@@ -549,27 +549,14 @@ void renderSkyPixelFloat(RE_COLBUFTYPE *collector, float x, float y)
switch (keyingType) {
case RE_ALPHA_PREMUL:
/* Premul: don't fill, and don't change the values! */
case RE_ALPHA_KEY:
/* Premul or key: don't fill, and don't change the values! */
/* key alpha used to fill in color in 'empty' pixels, doesn't work anymore this way */
collector[0] = 0.0;
collector[1] = 0.0;
collector[2] = 0.0;
collector[3] = 0.0;
break;
case RE_ALPHA_KEY:
/*
Key: Leave pixels fully coloured, but retain alpha data, so you
can composit the picture later on.
- Should operate on the stack outcome!
*/
/* collector[0] = 0.0; */
/* collector[1] = 0.0; */
/* collector[2] = 0.0; */
/* collector[3] = 0.0; */
collector[3]= 0.0;
collector[0]= R.wrld.horr;
collector[1]= R.wrld.horg;
collector[2]= R.wrld.horb;
break;
case RE_ALPHA_SKY:
/* Fill in the sky as if it were a normal face. */
shadeSkyPixel(collector, x, y);