2011-02-04 47 views
0

opengles -eaglview有一个背景黑色的粒子动画。但我不想黑色color.i只喜欢透明的视图,因为我的视图控制器已经有一个图像(BG)。 我想在uiimageview上应用粒子效果。 如何将黑色背景更改为opengl-es(iphone)中的透明视图?请帮助我... enter image description here如何将黑色背景更改为opengl-es(iphone)中的透明视图?

它是实际的输出..它是在opengles视图中创建的。 但我不想要背景黑色...

+1

请注意,覆盖非透明OpenGL ES内容将导致渲染速度显着降低。通过拍摄背景图像并将其作为闪烁效果背景下的纹理,您可能会更好地服务。 – 2011-02-04 20:47:27

回答

3

在opengl视图的渲染循环中,您是否将alpha清除为0.0?

glClearColor(0,0,0,0); 

另外,你有正确设置视图的不透明和drawableProperties?对于我使用的透明背景:

yourlayer.opaque=NO; 

yourlayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: 
[NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEaglDrawablePropertyColorFormat, nil]; 
相关问题