WebGL texture red and flickering on Apple devices - ios

I'm currently in the progress of writing a simple WebGL application, where multiple textures are blended on top of each other.
The application works fine in Chrome, Firefox and IE on Windows, and also works on Android phones.
On Apple devices, however, the textures are red and flickering in any browser. I tested this on Safari on iPhone or Chrome and Firefox on a MacBook.
For example, the desired result is a wooden texture:
However, on Apple devices, this is shown:
There are no errors and no warnings from WebGL. What could be the issue or a hint to the issue here?

In this case, the solution was to initialize all variables used inside the fragment shader, which was not done correctly.

Related

OpenGL errors on A7-devices in iOS 10

My image processing app behaves really strange on devices with an A7 chip (iPhone 5s and iPad Mini 2 tested) after the update to iOS 10:
Rendering takes extremely long and produces broken results. Instruments reveals that some of the glDrawElements calls return with GL_INVALID_OPERATION. I couldn't make out the cause for that, though.
The same code runs perfectly fine on newer devices (A8 and better) and on all devices in iOS 9. Did Apple change things I am not aware of?
Some more background info:
I'm partially using textures of GL_HALF_FLOAT_OES type
I make use of the EXT_color_buffer_half_float extension to render into those textures
I use the EXT_shader_framebuffer_fetch extension to process pixels in some of my filters in-place
As it turns out I was only partially assigning gl_FragColor in some of my shaders (e.g., gl_FragColor.rg = vec2(1.0, 0.0);), which caused the erroneous behavior in iOS 10. Possibly only in combination with a GL_HALF_FLOAT_OES-typed render target, though.
When I always assign the full vector (even though the other parts are unused…), it works like a charm.

Display CVPixelBuffer with YUV422 format on iOS Simulator

I'm using openGL ES to display CVPixelBuffers on iOS. The openGL pipeline uses the fast texture upload APIs (CVOpenGLESTextureCache*). When running my app on the actual device the display is great but on the simulator it's not the same (I understand that those APIs don't work on the simulator).
I noticed that, when using the simulator, the pixel format is kCVPixelFormatType_422YpCbCr8 and I'm trying to extract the Y and UV components and use the glTexImage2D to upload but, I'm getting some incorrect results. For now I'm concentrating on the Y component only, and the result looks like the image is half of the expected width and is duplicated - if it makes sense.
I would like to know from some one that has successfully displayed YUV422 video frames on iOS simulator if I'm on the right track and/or if I can get some pointers on how to solve my problem.
Thanks!

Animation Lags on iOS devices for apps designed in Adobe Flash Pro

I am developing iOS app and android app using adobe AIR and Flash CS6.The app contains lots of animations. Since Bitmap images do not give a good quality, I have kept the images in Vector form only. It runs fine on android devices but when I publish it on iOS device many animation lags. How can I solve this without affecting the quality of my animations? I am using AIR SDK version 4.0 and GPU rendering method. Any help would be appreciated.
There might be a few things you could try:
use TweenMax/TweenLite for your animations as the GreenSock library is optimized for performance
try setting cacheAsBitmap to true on the vector you're animating
convert vectors to cached bitmap data (http://esdot.ca/site/2012/fast-rendering-in-air-cached-spritesheets)
try see if using "direct" mode for rendering yields better performance; from what I've experienced GPU is not well suited for vectors

Inconsistent RGBA across devices

If you make a simple website with the code:
<div style='background-color: rgba(0,0,0,.05);width:50px;height:50px'></div>
and view it on various devices, you'll see very different colors.
On my iPhone and iPad, it looks white but on my MacBook you can see a definite light grey that looks close to #fafafa; I haven't tested thoroughly on other devices but I think that Android Chrome will sometimes display a third in between color.
This isn't an issue of different screen color capacities, because the iPad is definitely capable of displaying #fafafa.
So what's the story and is there any way to fix it?
rgba(0,0,0,.05) is an incredibly light color. A 5% tint is not visible on many lower end LCDs - especially 6bit panels. Personally, when I use RGBA I only tweak by 10% increments. Also, you will notice that #fafafa and rgba(0,0,0,.05) don't display the same because they aren't the same. #f2f2f2 is rgba(0,0,0,.05) (at least in Photoshop.)
You also have variances between the type of RGB. Devices also adapt differently based on lighting conditions - and they don't adapt the same way. There's also different screen types like AMOLED
From my experience that normally happens because of the contrast on the different screens and brightness settings. My suggestion is play with those.
Also check this for browser compatibility but those you mentioned should be ok:
http://css-tricks.com/rgba-browser-support/

Adobe air window with no chrome badly calculates dimensions when maximized

When i maximize an air window that has no chrome (no system chrome, no flex chrome but i think it's the same even if only flex chrome is used) a few pixels on all sides go offscreen.
Anyone has a solution for this or knows why it happens?
It's actually easiest to set the air window to the size of the monitor, then set your custom UI to the size of the monitor minus a few pixels. That's the only workaround that I've come up with.
The only downside to this approach may be a small rendering performance loss, since the AIR window has to take alpha transparent pictures of everything behind the window, but this likely so minimal that it won't make a difference (I invite someone to benchmark this).

Resources