模板緩存的glDrawElements結果我有一個使用GLKViewController iOS應用程序,我成立了渲染緩衝如下:GLKView在黑屏
內 @interface RootViewController : GLKViewController<UIKeyInput>
- viewDidLoad {
[super viewDidLoad];
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
GLKView* view = (GLKView*)self.view;
view.context = _context;
view.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
view.drawableStencilFormat = GLKViewDrawableStencilFormat8;
view.drawableMultisample = GLKViewDrawableMultisampleNone;
self.preferredFramesPerSecond = 60;
[EAGLContext setCurrentContext:_context];
}
然而,當我打電話平局後來:
glDrawElements(getGlPrimitiveType(ePrimType), numIndis, GL_UNSIGNED_SHORT, startIndis);
它導致黑屏並在Capture GPU Frame
,這個錯誤顯示出來:
Your app rendered with STENCIL_TEST enabled into a framebuffer without an attached stencil buffer.
有什麼,我錯過了什麼?
我記得由於深度測試之前有同樣的問題,我與view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
將其固定到viewDidLoad
我不知道有關模板測試,蘋果公司的文檔或者是很小的或非常一般以理論四周(即:漂亮很無用)。