OpenFL 8.9.5 with Lime 7.6.3
Target is HTML5 only
Textures are ATF Textures (DXT5 for Desktop, ETC1 for Android, PVRTC for iOS)
When using ATF textures in OpenFL HTML5 builds, you cannot longer use untextured Quads etc. Simply try to activate the Stats in Starling, the game will crash instantly Ok, not really a showstopper, as long as you now this… I never looked any deeper into the guts of OpenFL what might be the problem.
Ok, but now our game went live and a lot of people started playing. We are logging as many errors as possible. Our top error so far has been: “Cannot read property ‘location’ of undefined” Here is the full (minimized) stack:
Error: TypeError: Cannot read property ‘location’ of undefined
at sc.__flushGLTextures <-- Context3D
at Mb.drawMask <-- Starling Painter
100% of the devices are Android, so ETC1 textures are used. The only location where this can happen is the gl.uniform1i(…) call. Really don’t now why this is not working. Textures are loaded correctly etc. I commented the second one out (after __bindGLTexture2D(null);). This is not helping on the issue itself, but as a side effect fixes the untextured Quad / Stats crash problem mentioned in the second paragraph ^^. Not sure if it is safe to comment out? Tried it here on my local machine and everything looks exactly the same. Even if i comment out both calls to gl.uniform1i…
Textures are loaded via the classic Starling AssetManager. We had to modify the AssetManager to get the ATF textures to work:
Sadly the fix for the AtfTextureFactory isn’t working. I’m still getting the exception in ByteArray
The Context3D fix looks good. This will go live with the next patch (thursday hopefully). I can give you feedback a few days later.
The starling demo is running fine. The problem with the undefined “location” is not the same as the starling “untextured” error. Unfortunately I cannot reproduce the error myself. It happens only on Android and only in the callstack mentioned above. None of my Android devices shows the error. But Android in the wild is a different story. So many different devices… The mask on this Button is using a custom MeshStyle. Could this be the issue?
I suppose that shader may/may not use COMPRESSED_ALPHA (calling FilterEffect.tex which calls createAGALTexOperation under the hood) which was the issue I was seeing earlier when I replicated the problem
When using a sampler with alpha we add extra attributes to the generated GLSL to handle it:
I just wonder if the issue is that the current program has no alpha support or why this code (or similar code?) is mismatching:
Perhaps we just need more null checks to make sure the program does indeed have a texture _alpha and _alphaEnabled?