Shader issues on deployed app to iOS 7

Hi all,

Myself and friend have been working on a game with Codea for the last few months and all is going swimmingly well…

I have successfully setup the whole Xcode/Jenkins/TestFlight platform and can now download the game to my iPad and run it successfully…

So far so good. My friend has now bought a new iPad Air with iOS 7 and I managed after some messing about to add him to the provisioning profile and get it installed, so far so good…

However, to build the game maps I use a shader to replace certain map portions based on an elevation heightmap with shaded water colours as a one off draw into an existing image buffer…

This works fine on my iPad 2 running iOS 6, but the whole image ends up black on his screen…

I need to do a lot more diagnosis, but just out of interest, has anyone experienced any oddities in this area on iOS 7?

I will post more as I find it…thanks in advance for any hints (I know there is not a lot to go on at the moment)…

Cheers, brookesi

A brief addendum, I have set the general background colour to white, so I don’t think it is that the shader code is broken, as generally the background() colour shows through, it would appear that the image drawn to in setContext() which is then sprited onto the screen ends up uniformly black…

It could well be the shader code because iOS might have altered GLSL shaders a bit in iOS 7, but I’m obviously BSing there. Another issue might be the image doesn’t really exist to Xcode. Try cleaning your project with Shift-Comman-K, then running it again. Other than that, I’m guessing it’s a Codea issue. You could make an example program using your shader in Codea, export it, and see if that’s an issue in a separate project. Does the project have the issue in the iOS 7 simulator?

Thanks for the comments, i’m doing further checks this weekend to try and isolate it… It may be due to float precision in 64-bit iOS GL…

I will indeed try an example export… Thank you!

No problem Let me know how it goes. Also, if you could do me a favor and say “@Zoyt” when you are talking to me, that’d be great because I get notified. You probably just forgot, but IDK.

Hi @Zoyt,

Yep, fixed it, not actually a shader problem. The problem was thhat I was creating a large image and using it as a buffer in setContext() to draw a mesh into, basically:

local buffer = image(3096, 2304)
setContext(buffer)
self.mesh:draw()
setContext()
return buffer

In iOS 6 this is fine, in iOS 7 this creates a black image with Open GL framebuffer errrors…

Luckily I had an easy fix as I was passing in a source image of the correct size, so I just do

local buffer = self.srcImg: copy()

and that doesnt cause the problems…

Why, I have no idea :wink:

Cheers,
Brookesi

@brookesi - Great to hear you fixed it. :slight_smile: