blit alpha transparency

364 views
Skip to first unread message

Paul

unread,
Feb 16, 2012, 5:56:12 PM2/16/12
to pyglet-users
when i blit an image w/ alpha transparency, the transparent parts show
white
and i already tried this code:

glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

but it didn't work...any help? thanks a lot

Richard Jones

unread,
Feb 16, 2012, 6:17:22 PM2/16/12
to pyglet...@googlegroups.com
Hi Paul,

Could you provide a more complete simple code example and a small sample image?


Richard

> --
> You received this message because you are subscribed to the Google Groups "pyglet-users" group.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
>

Paul

unread,
Feb 16, 2012, 10:44:22 PM2/16/12
to pyglet-users
sorry about that, heres a link to an example of this problem:
http://www.mediafire.com/?8278qayj4toq61y
the white 'border' around the main image should be transparent

Petr Viktorin

unread,
Feb 17, 2012, 2:13:26 AM2/17/12
to pyglet...@googlegroups.com
Move the glEnable and glBlendFunc into the on_draw function.


def on_draw():
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
window.clear()
background.blit(0, 0, 0)
ice.blit(10, 10, 0)

Txema Vicente

unread,
Feb 17, 2012, 5:04:49 AM2/17/12
to pyglet...@googlegroups.com
Call glEnable after window creation.

El 17/02/2012 4:44, Paul escribi�:

Paul

unread,
Feb 17, 2012, 7:57:43 AM2/17/12
to pyglet...@googlegroups.com
>
thanks everyone, and ill try it out !
Reply all
Reply to author
Forward
0 new messages