正常來說在opengl是需要有兩的frame buffer
然後把color的資訊放在back buffer,不要swap過去,
如此user就不會看到。
但是在iphone上使用glkview我卻一直做不出來
原本想要用
http://mickyd.wordpress.com/2012/05/20/creating-render-to-texture-secondary-framebuffer-objects-on-ios-using-opengl-es-2/
glGenFramebuffers
glBindFramebuffer
來達成效果,但是卻始終不成功。
之後便改用
http://stackoverflow.com/questions/7861316/ios-5-glkview-how-to-access-pixel-rgb-data-for-colour-based-vertex-picking
只是我在draw in rect多加一個flag,只有在要snapshot的時候,才畫出color,
結果終於成功......
有用的參考資料:
http://stackoverflow.com/questions/9746602/getting-default-frame-buffer-id-from-glkview-glkit
http://stackoverflow.com/questions/6774197/opengl-es-2-0-object-picking-on-ios
http://stackoverflow.com/questions/7861316/ios-5-glkview-how-to-access-pixel-rgb-data-for-colour-based-vertex-picking
http://mickyd.wordpress.com/2012/05/20/creating-render-to-texture-secondary-framebuffer-objects-on-ios-using-opengl-es-2/
http://developer.apple.com/library/ios/#documentation/GLkit/Reference/GLKView_ClassReference/Reference/Reference.html
http://stackoverflow.com/questions/10958081/ios-render-to-and-read-from-depthbuffer-for-offscreen-processing
hi 小筆 can i get any working sample code on this picking that u have explained above?I m new to opengl and hoping a working model will help me to implement this same. my e-mail address is this: 409347461@qq.com
回覆刪除hi 小筆 can i get any working sample code on this picking that u have explained above?I m new to opengl and hoping a working model will help me to implement this same. my e-mail address is this: 409347461@qq.com
回覆刪除