简体   繁体   中英

how to change black background to transparent view in opengl-es(iphone)?

opengles -eaglview have a particle animation with background black color.but i don't want black color.i like only transparent view because my view controller already have an image(BG). i want to apply particle effects on the uiimageview. how to change black background to transparent view in opengl-es(iphone)?please help me... 在此处输入图片说明

it is actual output.. it is created in opengles view; but i don't wants background black color...

In your rendering loop for the opengl view are you clearing the alpha to 0.0?

glClearColor(0,0,0,0);

Also, have you set the opaque and drawableProperties of the view correctly? For transparent backgrounds I use:

yourlayer.opaque=NO;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM