[Bf-committers] glReadPixels

Campbell Barton ideasman42 at gmail.com
Mon Nov 9 08:09:17 CET 2009


this needs to be enabled in ghost. edits needed for windows and linux
to get this working
http://blenderartists.org/forum/showthread.php?t=159496&page=2

On Mon, Nov 9, 2009 at 6:38 AM, Goat Man <goatman.py at gmail.com> wrote:
> I'm wanting to capture the screen for managed hardware rendering, and the
> alpha channel is needed so that later the passes can be composited with
> software rendered layers.  It seems that glReadPixels will not return the
> alpha channel?  I have captured the alpha before from a hardware render
> outside of blender from python/pyopengl/pygame.  I have tried the code below
> from blender2.49 (haven't tried it yet from 2.5).
> Could it depend on my graphics card drivers?
> -brett
>
>
> b = BGL.Buffer( BGL.GL_BYTE, (screenx, screeny, 4) 0
> BGL.glReadPixels( 0, 0, screenx, screeny, BGL.GL_RGBA, BGL.GL_UNSIGNED_BYTE,
> b )
>
> for y in range(screeny):
>  for x in range(screenx):
>    r,g,b,alpha = b[ y ][ x ]
>
> #alpha always is 255
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list