PDA

View Full Version : Merging two rendered objects



rrankene
06-13-2005, 09:21 AM
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?

Thanks!
Robert

powerpad
06-13-2005, 12:55 PM
you can render what you want into a texture and then texture a quad or whatever you want if this is sufficient.

Omaha
06-13-2005, 08:40 PM
Have you considered clearing the color flags when doing your stencil drawing? Not quite sure I understand your problem entirely, though.