IBOutlet properties must be readwrite… mostly

I couldn’t for the life of me figure out why two out of three IBOutlet-connected properties were being connected just fine, but a third wasn’t.  What was different?  Long story short: One was “(weak)”, meaning implicitly readwrite.  Apparently when I added that one I got it right accidentally. One was “(weak, readonly)” and yet still worked.… Read more

SceneKit & shaders

Note: Since writing this originally I’ve figured out how to get at least some aspects of shaders working.  I’m still trying to flesh out the rest.  I’ll post an update or revised entry at some point. Ugh.  SceneKit supports shaders, technically.  But it’s almost unequivocally unusable.  Let me count the reasons: It doesn’t support geometry shaders… Read more

SCNSphere can be expensive to recreate

In a current project I’m drawing hundreds of spheres, of varying sizes.  I discovered at one point that with them all in view simultaneously, performance was very bad (<10 FPS on my 6970M).  Trial and error revealed that changing the geometry complexity – by changing the segment count of my spheres – made a huge difference.… Read more

SCNView can have overlapping views, but only if layer-backed

In fact I’m pretty sure this behaviour dates back to NSOpenGLView and possibly others.  I suppose technically this has always been the case; that overlapping views weren’t supported at all before layer-backing.  But I had forgotten, so it took a little bit of experimenting to jog my memory. It’s interesting that when not layer-backed, all… Read more

+[SCNTransaction setCompletionBlock:] always invokes the block immediately

It’s supposed to invoke your block when all the animations in the current transaction have completed. It doesn’t; it runs it as soon as the transaction is committed. Le sigh. It does appear to do it from the main runloop at least, as documented. So there is technically a delay, as a consequence of that… Read more