This only happens on iPhone 6? Which version of iOS 9… 9.0 or 9.0.1? This seems like a potential Apple bug to me, if it’s isolated to a specific device. Have you searched online to see if other developers are having this issue with non-Corona-built apps?
Can you file a bug report on this, including the basic project (and the images that are effected) so that we can test on our side? I’m not sure it’s a Corona bug or not, but we can at least test to see if it’s reproducable on our end.
The problem seems to be when I added a hue to the sprite/image. I took the hue filter away from the stars and it fixed the problem. Now the problem is how to get hues working again.
Cool, thanks. Looking at my code, there’s no hue filter, only brightness and it’s attached only to one of the affected image types. Other affected images don’t have a filter so it may be that there’s an issue with the filter implementation in general.
All I can surmise at this point is that there is a specific issue with the hue filter and the GPU on the iPhone 6. We’ll need to test this on our in-house devices, but if you need an “immediate” fix, then I suspect you’ll need to find another method than the hue filter for your images. I realize that might not be a realistic solution in the short term, but GPUs can vary widely in behavior and we’ll need to explore what may be happening here.
The built-in hue shader does not support transparent regions for performance reasons b/c supporting 0 alpha in a texture would require an if-else branch in the shader.
If you apply the hue filter on a texture with regions of 0 alpha, you will get undefined behavior in those regions (divide by 0 is undefined in a shader), meaning the end result will vary from device to device.
Here’s a version up on our Shader Playground of the hue shader that supports 0 alpha, though with a performance penalty due to the if-else branch. You can vary the “angle” in the first component of CoronaVertexUserData: https://goo.gl/RaXU3N
Thanks for the explanation, Walter. One of the affected images I have uses the brightness filter, so I assume it too doesn’t support 0 alpha (in iPhone 6 GPU I guess since it’s fine on iPad Air).
Is there another filter beside hue and brightness that can handle 0 alpha? Ideally, I can just swap a different filter in and live with the varied visual effect, since the main purpose of the effect to convey a state change in the player object.
Ah, yes brightness is also affected. Both hue and brightness have to convert from colors with pre-multiplied alpha, to those without, and that requires a divide by alpha.
I’m not seeing any other filters that rely on a divide by alpha, so I think it’s just those two.
This is also a huge problem for our app that is currently released. We use brightness on thousands of images in our app and they are all displaying incorrectly.
As a temporary solution we are considering looking at the device and if it happens to be an iphone 6’s, then we will not use brightness. Would this temporary solution be possible?
Here’s a version of the brightness shader that accounts for 0 alpha in the Shader Playground, the first component of CoronaVertexUserData is the “intensity”: https://goo.gl/Urhkj2