I am rendering brush strokes in an application to a secondary framebuffer to later render them onto the main framebuffer. However, I am getting weird behavior when clearing the framebuffer. The alpha channel doesn't appear to clear to 0. When I render it, the texture is completely white with alpha of 1.0 it seems. Code below:
// clears the brush strokes from the secondary framebuffer- (void) clearBrushStrokes{ glEnable(GL_BLEND); glBindFramebufferOES(GL_FRAMEBUFFER_OES, renderFrameBuffer); glClearColor(1.0, 1.0, 1.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);}// snippet of creation of the render textureglGenFramebuffersOES(1, &renderFrameBuffer);glBindFramebufferOES(GL_FRAMEBUFFER_OES, renderFrameBuffer);glGenTextures(1, &renderTexture);glBindTexture(GL_TEXTURE_2D, renderTexture); NSInteger deviceSize = [iChalkDrawingModel sharediChalkDrawingModel].powerOfTwoSize; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, deviceSize, deviceSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, renderTexture, 0);