0

What GLBlendFunc would solve this problem?

I am currently using:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

I want the paint app to act like real paint would, but it seems that when using a lower opacity color, it won't paint over a solid white color.

Here is my example enter image description here

What I am expecting is that in Step 3 the light pink paint would still paint lightly over the previous white strokes even though the opacity is at 0.1 not 1.0

I would like it to behave other paint app. These example is from Photoshop. enter image description here

The Way
  • 594
  • 5
  • 15
  • glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) might do the trick. – Matic Oblak Jan 06 '14 at 07:46
  • Nice try, It's almost what I need, the problem with this method seems to be that the 0.1 opacity paints on as if there was nothing underneath. So, in step 3 the big pink spot gets replaced with the faded pink instead of adding over the top. Thanks for the effort. – The Way Jan 07 '14 at 19:44
  • Could you add some image with desired effect if possible (made in some other application possibly). Also with the blend function I gave you the faded pink brush should not even be visible on the big pink spot "colour = C*.1 + C*(1.0-.1)" should result in the same colour (C - pink RGB colour). – Matic Oblak Jan 08 '14 at 08:30
  • I added a desired result for step three created in Photoshop. The best way to describe what I want would be like painting in real life. When paint is added to a page it goes over whatever is below. I have been able to get better results by lowering the opacity on the white, which lets the low opacity pink to cover it up more. – The Way Jan 09 '14 at 13:43

0 Answers0