2011-11-09 7 views
1

私はUIImageViewで標準UIViewの上にOpenGLビューを配置しようとしています。私はOpenGLのビューに描画するためにCocos2Dを使用しています white alpha blendingiPhone上のApple UIとのアルファブレンディング

CCDirector *director = [CCDirector sharedDirector]; 
EAGLView *glView = [EAGLView viewWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) 
           pixelFormat:kEAGLColorFormatRGBA8 // kEAGLColorFormatRGBA8 
           depthFormat:0      // GL_DEPTH_COMPONENT16_OES 
        ]; 
[glView setMultipleTouchEnabled:YES]; 

[director setOpenGLView:glView]; 

if(![director enableRetinaDisplay:YES]) NSLog(@"Retina Display Not supported"); 
[director setDeviceOrientation:kCCDeviceOrientationPortrait]; 
[director setAnimationInterval:1.0/60]; 

[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888]; 

[[CCDirector sharedDirector] runWithScene:[PPAvatarEditorScene scene]]; 
[[CCDirector sharedDirector] resume]; 
[glView setOpaque:NO]; 
[avatarImage addSubview:glView]; 

:私はOpenGLのビューに何かを描くと、私は以下の見白い線につながるわずかなアルファブレンディングの問題を参照してください。アルファピクセル形式またはテクスチャ形式に問題はありますか?

答えて

1

黒にglClearColorを設定してみてください:

glClearColor(0, 0, 0, 0); 
+0

私はアルファチャンネル(glClearColor(0、0、0、1.0);)クリアした場合にそれが正常に見える –

+0

をしかし、あなたのようにクリア言及はそれがないだけのように見えますスクリーンショットで。私はそれがどのようにGL呼び出しやピクセル形式よりも描画する方法と関連があると考え始めています。 –

+0

これはおそらくGL状態です(glEnableメソッド)。 – LearnCocos2D

関連する問題