Reputation: 2046
I am trying to render a square border (variable thickness so lines won't work). I was thinking 4 quads would do the trick (all the same size, just rotated and translated for each side). Then I thought, 2 quads should do it- Draw one then draw a small one in the middle. However, I'm actually trying to create a 'hole' in the box with the second one. I think I could probably apply some blend function that does what I want.
I don't quite understand what happens.
I get the idea of a factors but I don't understand the definition of source and destination. Would src be the existing pixels at that location or the pixels I plan to put there? Destination seems intuitive to call the buffer though since that's ultimately where I plan to put the pixels.
If that is the case, when I plop down my first box, I ruin the pixel data and no matter how I try to blend, I will fail. Is this correct? That still leaves me clueless what the parameters mean (sfactor,dfactor) What happens if I put GL_DST stuff in the src, and in the dst? Is there a nice explanation of how these work? I've found
http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml
http://www.andersriggelsen.dk/glblendfunc.php
But there is no nice examples of how to actually apply these factors to the pixel data.
Upvotes: 0
Views: 340
Reputation:
Destination is the pixel data of the video buffer(framebuffer) and source is pixel data you want to blend on.
It says in the text:
framebuffer (the ''destination''color)
new pixel (the ''source'' color)
Upvotes: 1