fast_rx wrote:Jinks,
Why don't you compare those 2 methods with the "long" way of doing it? In other words, calc the R,G, and B values separately and put them back together.
I've tried this stuff before, and I always ended up with a blending routine that chokes on pure colors like (255,0,0)...
My normal way of doing it is bomb proof.
MODIFY LATER TO TIE UP LOOSE ENDS.
If you split RGB into 0-31, 0-63, 0-31 for both colours then do mul and shift down by >>5. You get same components. So the method is bomb proof.
I normally push it futher than that by 0-31 opacity flip ^31 not 32- then gather the lost colour just after blend before >>5. Dither variable is open over loop.
ink+=dither&(mask<<5);
dither=(dither&mask)+(ink&mask);
ink=(ink>>5)&mask;
which does a needed job of reducing graduating colour banding in 565.
Okay I might recode it to test but I can "see" the bits in mine they just don't stray. What got me about Tala's method was +/- 0-31 clearly uses 6 bits and there is only 5 available above the green and it can't be carry or something as 0xf8 only has five to green. That's why all the stat stuff is in there to quantify the error - which then didn't happen.
Anyway I've got my simple brain trying to code two Gourauds one for space one for clouds moving in different directions. With it all trying to just use a normal set of registers so my simple head is full of crazy shit techniques and will be till I come down.
