Bitmask Filter Anaglyph

This Generator works the same as the old RedBlue library.

Consider this image:

four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.

Render it twice with the camera shifted slightly to the right and left. The camera shift is not blatantly obvious in this case but you can see it if you look at the left side of the gray cube.

four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.

Filter each image. You will notice that the left red filtered image makes the green and blue cubes look black. The cyan filtered image makes the red cube look black.

four cubes with black edges and red background. Going clockwise from the upper left, the cube faces are red, black, grayish red, and black.four cubes with black edges and cyan background. Going clockwise from the upper left, the cube faces are black, yellow, blue, and blue.

Add the two images together. If you open both of those images in Photoshop as two layers and set the Layers Mode to Addition, you will get:

four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.

Add finishing touches to the result with the postDraw method:

four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.

If you are wearing red-cyan 3D Glasses you will notice that only the gray cube looks 3D. The primary colored cubes look terrible because the filtering made them look black in one of the two images. This is one of the weaknesses of this Generator: all colors need to be shades of gray or somewhat close to gray.

This generator can also make anaglyphs suitable for magenta-green 3D Glasses. The left image is filtered red and blue (magenta) and the right image is filtered green.

four cubes with black edges and magenta background. Going clockwise from the upper left, the cube faces are red, black, purple, and blue.four cubes with black edges and green background. Going clockwise from the upper left, the cube faces are black, green, green, and black.

Adding them together yields:

four cubes with black edges. Going clockwise from the upper left, the cube faces are red, green, gray, and blue.

I'm not really a fan of magenta-green anaglyphs, but if you happen to have a pair of that kind of filtered glasses, you can find a use for them here.