Merging two rendered objects

I’m pretty new to OpenGL, and am modifying an application that draws an OpenGL image over some 3D scenery. The scenery was rendered using an old package called VisKit, then I added some OpenGL code to draw the graphics (mostly green lines). Unfortunately, the graphics has to be rendered with some use of stencil buffers and drawing of black rectangles to mask some of the already drawn graphics (I can’t replace that portion with stencils). The black rectangles erase the scenery.
So what I really need to do is render the graphics seperately, then merge the result with the scenery. The resulting graphics is simply green lines on a black background. Any suggestions for how best to accomplish this? Can I somehow render it into a texture buffer then merge it using an alpha channel?


you can render what you want into a texture and then texture a quad or whatever you want if this is sufficient.

Have you considered clearing the color flags when doing your stencil drawing? Not quite sure I understand your problem entirely, though.