MixImages function help

BlitzPlus Forums/BlitzPlus Programming/MixImages function help

Yes, the OR operation would blend two colors together, and there is no need to separate out the individual RGB values either to do it (time saver, there). Logical AND tends to subtract colors, rather than blend them together. In fact, logical AND is what is used to mask a graphics image so that the non-black portion of an image is rendered, but not the black portion (assuming of course that the default COLOR 0,0,0 is used for the transparent mask color).

Back to your speed problem. After thinking about it a bit, I realized that you are doing the readpixelfast / writepixelfast on a LOT of pixels! At 640x480, you are reading 307200 pixels each for b1 and b2, and then OR-ing those together and writing 307200 pixels, for a total of 921600 pixels. At 800x600, the total jumps to 1440000 pixels! That's smokin'!

If I understand your application, you are working in the Graphics3d mode (you mentioned Texture and Camera), and are trying to do a 3d-stereoscopic-type image.

If this is the case, is it necessary to do the entire screen's area for each imagebuffer, or can you get away with a portion of the screen?

If you MUST use the entire screen, take a look at the triple lockbuffer commands set you are using in your Function as I mentioned in point 2 of my original response. I don't know if using three lockbuffers is OK, or if they are in any way impeding each other. One way to find out, is to lockbuffer the first imagebuffer, read its color info into an array, then unlock it and lock the second imagebuffer, reading it into another array, unlock it, then lock the third imagebuffer, and writepixelfast (via logical OR) the two array values into it, finally unlocking it. See if that causes any speed increase.