101Fermer103
bearbecueLe 01/05/2012 à 01:39
0^2/bob> ah ben vala : http://softpixel.com/~cwright/programming/colorspace/yuv/

l'alpha blending ya pas de pbl, mais l'additive blending (comme c'est le cas ici) est effectivement beaucoup plus relou grin

Adding colors in YUV is a bit more tricky. The Y and UV components need to be treated differently, since they represent different things.

Adding the Y channels is easy; You just add them.
Y3 = Y1 + Y2.

It's probably a good idea to saturate the Y value to 255 or 1.0.

Adding the U or V channels is more involved. You have to average the two input values.
U3 = (U1 + U2)/2, V3 = (V1 + V2)/2.
U and V should saturate as well. Otherwise, several additions can cause unusual color distortions when combined with high Y values.


donc les UV doivent etre alpha-blendes avec un alpha a 0.5, et les Y doivent etre blendes en additif.
ceci dit, avec l'idee des deux rendertargets qui stockent les UV et les Y separement, c'est surement faisable oui