I am drawing several shapes that all have a different grayscale.
Is it possible that when two shapes overlap that it draws according a max(src, dst) function. So a dark circle overlapping a white square would still show the entire square.
I have tried setting glBlendEquationEXT to GL_MAX_EXT, but no result. Any ideas?
See image for a simplified example, left if how it prints now, it should be like on the right.
Thanx again all.
ofEnableAlphaBlending(); //this just turns on blending.
glBlendFunc(GL_SRC_COLOR, GL_ONE); //lets blend to 1.0 eg max
that should do it!
Hi Theo, that works fine if the max color is white, but in some cases it is a light gray…
But some messing around at 4am this morning I found that this works (seems i was pretty close)
//draw black box
//set blending functions
// middle gray rect
// light gray circle
// dark gray circle
// disable blending
This should draw as if the light gray circle is on top, then the middle gray square and than on the bottom the dark gray one. But they are drawn in a different order.