How do you activate multisampling in OpenGL ES on the iPhone?

前端 未结 2 1268
故里飘歌
故里飘歌 2020-12-15 01:34

I\'m experimenting w/ improving the \"resolution\" of an OpenGL ES based app. Apple mentions here (developer.apple.com) that OpenGL ES in iOS 4 supports multisampling... an

2条回答
  •  伪装坚强ぢ
    2020-12-15 02:20

    The WWDC session 415 video goes over this a bit, so grab and watch that if you can.

    Essentially, you create a second framebuffer for msaa rendering using glRenderbufferStorageMultisampleAPPLE for its depth and color buffers. Then you bind this multisample framebuffer, render your scene, then do the multisampling resolve into your main framebuffer:

    glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, msaaFramebuffer);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, defaultFramebuffer);
    glResolveMultisampleFramebufferAPPLE();
    

    then bind your render buffer and present it as you would normally.

    I'm still relatively new to OpenGL ES myself, but I hope this helps put you on the right track.

提交回复
热议问题