[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Re: [pygame] [OPENGL]Combining blended and unblended scenes



recently i found what was the real issue: Changing the alpha value of color using glColor4f does not affect the translucency of what I am drawing. Any ideas how to solve this?
here's the list what i set up during initialization:
self.win=display.set_mode((width,height),(FULLSCREEN*fscreen)|OPENGL|DOUBLEBUF)
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45, float(width)/height, 0.1, 100.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glEnable(GL_TEXTURE_2D)
glShadeModel(GL_SMOOTH)
glClearColor(0.0, 0.0, 0.0, 1.0)
glClearDepth(1.0)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA,GL_SRC_COLOR)
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
.. and a light:
    glEnable(GL_LIGHTING)
    glLightfv( GL_LIGHT0, GL_AMBIENT, [ intensity, intensity, intensity, 1.0] )
    glLightfv( GL_LIGHT0, GL_DIFFUSE, [ 1.0, 1.0, 1.0, 1.0] )
    glEnable( GL_LIGHT0 )
I'm pretty sure that theres nothing wrong during rendering; I tried to put the coloring statement everywhere: another function, before glBegin and between glBegin and glEnd. 
Any ideas? (Again realize please that i'm a newbie. Don't shout please or you'll make me cry :D)