|
|
#1 | ||
|
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
Erm, Atero? | XOR Blending
As i said i was working through your Primer in order to get some more knowledge on 3d stuff. Well i figured out that something was missing.
Quote:
Quote:
The programming code woud be: x xor y = (x or y) and not (x and y) And here is a tabe to make this more obvious: x|y|result -+-+------ 0|0|0 0|1|1 1|0|1 1|1|0] As we know, the color channels are calculated seperately. Now we imagine x and y to be the two red-channel values. First, AVS converts them too boolean values which means dividing by 255 and rounding up or down. That means a color value of 128-255 is 1, a color value of 0-127 is 0. Then, AVS does XOR, as explained before. Finally we need to get a useable color value as a result which means multiplying the result with 255. To put it in a nutshell, a value above 127 and a value below 128 will result in a full valued color channel with 255, if the values are both above 127 or below 128 this will result in color channel of 0. Well, i could also have pm'ed this but if Atero did'nt know about XOR there are probably more around who don't either. Last edited by Magic.X; 2nd April 2003 at 07:41. |
||
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|