def draw_shadow_lem(self): with push_attrib(gl.GL_STENCIL_BUFFER_BIT | gl.GL_COLOR_BUFFER_BIT): gl.glStencilFunc(gl.GL_NOTEQUAL, 1, 1) gl.glStencilOp(gl.GL_KEEP, gl.GL_KEEP, gl.GL_REPLACE) gl.glEnable(gl.GL_STENCIL_TEST) gl.glEnable(gl.GL_BLEND) gl.glBlendFunc(gl.GL_ZERO, gl.GL_CONSTANT_ALPHA) gl.glBlendColor(1.0, 1.0, 1.0, 0.3) with push_matrix(gl.GL_MODELVIEW): gl.glMultTransposeMatrixf( float_ctype_array(1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)) self.draw_lem_model()
def draw_shadow_lem (self): with push_attrib(gl.GL_STENCIL_BUFFER_BIT | gl.GL_COLOR_BUFFER_BIT): gl.glStencilFunc(gl.GL_NOTEQUAL, 1, 1) gl.glStencilOp(gl.GL_KEEP, gl.GL_KEEP, gl.GL_REPLACE) gl.glEnable(gl.GL_STENCIL_TEST) gl.glEnable(gl.GL_BLEND) gl.glBlendFunc(gl.GL_ZERO, gl.GL_CONSTANT_ALPHA) gl.glBlendColor(1.0, 1.0, 1.0, 0.3) with push_matrix(gl.GL_MODELVIEW): gl.glMultTransposeMatrixf(float_ctype_array(1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)) self.draw_lem_model()
def draw(self, width, height): transition = self.queue[0] gl.glBlendColor(0.0, 0.0, 0.0, transition["phase"]) self.slideshow.draw_slide(width, height, transition["previous"]) gl.glBlendColor(0.0, 0.0, 0.0, 1.0 - transition["phase"]) self.slideshow.draw_slide(width, height, transition["next"])
def setup(self): gl.glEnable(gl.GL_BLEND) gl.glBlendFunc(gl.GL_CONSTANT_ALPHA, gl.GL_ONE) gl.glBlendColor(0.0, 0.0, 0.0, 1.0)