EXC_BAD_ACCESS with lightmaps

I’ve got a really, really weird problem that appears to be related to Beast-generated lightmaps. I can deploy to device just fine right up until I lightmap my scene. Once I do that and deploy to device (it works fine in-editor), I get an EXC_BAD_ACCESS during load. It happens after the stream of “this message is harmless” messages that appear after “applicationDidFinishLaunching”. Again, this only happens after I’ve lightmapped the scene.

I thought perhaps it was something with a messed up model file, so I pulled each and every model into my modeling app, optimized it (remove orphaned vertices and the like), and re-saved it. Initially, that seemed to get things working again. But then later on, it started happening again, and I can’t figure out what is causing it.

Does anyone have any clue as to what could cause this and what I should check? I can’t seem to get Xcode to report any more information than that. I’ve built with debugging symbols, but nothing but the “EXC_BAD_ACCESS” will show up. Help! I’m desperate and on an incredibly tight schedule.

Thanks in advance to my future hero. :slight_smile:

I think its just going over some texture limit, I would try putting some of the less important textures to compressed

I wish it were that simple. It was doing this in a scene with I think only two or three PVRTC compressed 1024x1024 textures. And this is on an iPad 2, so I’m WAY inside my texture limit.

Okay, it looks like, of all things, it was having fog turned on! Again, this was on an iPad 2, I haven’t tested it on other iOS devices yet so I don’t know if this is an iPad 2-specific issue (as I have seen a couple of rendering issues unique to iPad 2). But somehow enabling fog was messing with the lightmaping. If I had no lightmaps, it would run with fog on. If I had a few lightmapped objects, however, if fog was on, it was generate EXC_BAD_ACCESS. As soon as I turned fog off, the error went away. REALLY strange!

Please submit a bug report.
Thanks!