PDA

View Full Version : alpha blending of multiple render targets



miujin
04-20-2012, 05:27 AM
Hi,

I use Multiple Render Targets to render my Framebuffer and my Pickingbuffer at the same time. Now I want to implement alpha blending in the Framebuffer. The problem is, when I activate the colors in the pickingbuffer are also use alpha blending and so i cannot identify the picked triangle (i'm using color picking)

Is it possible to activate alpha blending for one framebuffer and deactivate it for another. I know that this is possible with DirectX 10.1

Thanks

malexander
04-20-2012, 08:16 AM
You can, but you need the GL_ARB_draw_buffers_blend (http://www.opengl.org/registry/specs/ARB/draw_buffers_blend.txt) extension to do so (also part of OpenGL 4.0).

arekkusu
04-20-2012, 10:31 AM
Actually you only need EXT_draw_buffers2 (http://www.opengl.org/registry/specs/EXT/draw_buffers2.txt) which is available on much more (circa 2006) hardware than ARB_draw_buffers_blend.

Alfonse Reinheart
04-20-2012, 04:23 PM
Good catch.

Actually, don't bother with the extension; it's a core feature of GL 3.3. glEnablei(GL_BLEND, X), where X is the draw buffer you want to enable blending for.

All buffers with enabled blending will use the same blend parameters, but you can enable or disable blending individually.