0

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.

Chemistpp
  • 2,006
  • 2
  • 28
  • 48

1 Answers1

1

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)

  • Yep, okay, I think it's impossible to do what I was trying to do. I can make a transparent box or I can make an opaque one. Either way, the next box is oblivious to the first box and cannot separate it from the original texture stream. It makes more sense to render 4 quads and not worry about blending it. – Chemistpp Jun 27 '13 at 00:00
  • @Chemistpp Just alpha blend it and you can have partial transparency. –  Jun 27 '13 at 00:02
  • Well, that's my default, but this is more or less to render a border around a preexisting item (panel, menu, edit box, button, etc...) – Chemistpp Jun 27 '13 at 00:04