Results 1 to 2 of 2

Thread: Attaching depth buffer cause a magenta screen

  1. #1
    Junior Member
    Join Date
    Aug 2010

    Attaching depth buffer cause a magenta screen

    Hello Everyone,

    I have an OpenGL-ES 1.1 project for the iPad. I am having an issue that causes the full screen to be rendered magenta. It happens when I attach a depth buffer. If I do not attach the depth buffer everything renders as expected. NOTE: The clear color is not set to magenta.

    Here is my setup code

    Code :
    		glGenFramebuffersOES(1, &framebuffer);
    		glBindFramebufferOES(GL_FRAMEBUFFER_OES, framebuffer);
    		glGenRenderbuffersOES(1, &colorRenderbuffer);
    		glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);
    		glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, screenWidth, screenHeight);
    		glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, colorRenderbuffer);
    		glGenRenderbuffersOES(1, &depthRenderbuffer);
    		glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
    		glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, screenWidth, screenHeight);
    		glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);

    If I comment out the last four lines, things render correctly (without correct depth course)

    Any help at all would be greatly appreicated.

  2. #2
    Junior Member
    Join Date
    Aug 2010

    Re: Attaching depth buffer cause a magenta screen

    Also, on each render it is setting the error


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean