Xcode and effects shaders

I have just taken a project from my ipad that was using the Effects:Ripple shader as:


When I try to compile this, it works, but when I run it, I get the error:

Bad argument #1 to 'shader' (Shader not found)

In my xcode project, the Resources/ShaderPacks has an Effects.shaderpack with Ripple.shader, and 3 files.

Why would this fail?

Figured this out - the ios simulator doesn’t handle it. Wen I built for the ipad, it runs fine,

Next issue: has anyone had a problem with spriteList()? When I use it to get a list of images from my documents folder, it comes back with no elements, even though my xcode project has 50 images in it.

Forgot to mention: readimage() works, I can load an image by explicitly stating the file name.


@aciolino, I am having issues with saveImage() but not with pulling up a list of sprites

I’ll look into this @aciolino, thanks for reporting it.

Back to the first problem, I got that error message when running my app on my iPad but launched from Xcode. I didn’t get it in the simulator, and I didn’t get it when I’d actually installed the app.

@Andrew_Stacey sometimes that can happen if you have an old version of the app on your iPad with a different set of data, and then you add shader folders to one of the shader packs. (Or spritepack folders to SpritePacks/).

Xcode is a bit buggy when it comes to folder references (the blue groups in the project navigator). It often won’t understand that it needs to copy everything to your iPad again — even though the contents of the folder reference have changed. Sometimes you need to clean your build before knows to copy everything.

I tend to do a full clean every few builds for that reason - all modern compilers have compile bugs :slight_smile:

@aciolino to be overly pedantic :slight_smile: — it’s not a compiler bug (LLVM/Clang is very good). It’s Xcode the IDE not packaging resources correctly.

You’re right - I was grouping the IDE and the compiler. Yes, modern IDE’s have bugs :slight_smile: especially with resource management.