OpenGL Alpha Blend Error after IOS7 update
After update to IOS 7 I am seeing an error with images rendering with GL_BLEND enabled and the blend func set to GL_ONE, GL_ONE_MINUS_SRC_ALPHA.. I have checked that devices that have not been updated to IOS 7 do not show this problem.
Explanation of what I am seeing. -Images that have any alpha that is not zero render as non transparent (opaque).
This resulted in show white outlines around art that was blending out to full alpha to hide jagged edges.
Notice the render artifacts around the each of the parts that make up this little guy.
Another thing to note is that the art images are NOT compressed to PVR4.
Keep in mind again that this all worked pre IOS7 with no graphical errors.
Thanks for you help..
Render Notes: glEnable(GL_BLEND) glBlendEquation( GL_FUNC_ADD ) glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA )
After looking into this.. I have come to think that something has changed with precompiled alpha. I have no idea what could have changed in iOS 7 .. Still working on this.
Solved My understanding is that the call textureWithContentsOfFile without saying you wanted GLKTextureLoaderApplyPremultiplication in our case seemed to still produce a image that had premultiplied alpha. By adding into the options that YES we wanted it to do so .. everything now on iOS7 is working.
如果您正在使用加载纹理的方法-textureWithContentsOfFile:options:error
of GLKTextureLoader
,那么您可以尝试将GLKTextureLoaderApplyPremultiplication
设置为YES
添加到选项字典中。
NSDictionary * options = @{GLKTextureLoaderApplyPremultiplication:@YES};
NSError *err;
GLKTextureInfo *ti = [GLKTextureLoader textureWithContentsOfFile:path options:options error:&err];
链接地址: http://www.djcxy.com/p/34008.html