I'm a fairly experienced iOS developer but a total SceneKit newbie, trying to simulate some planets in a basic app.
To that end, I'm using high-res normal and diffuse maps of Mars, Venus, etc, applied to basic spheres. And they work! They look awesome, exactly what I was going for.
The problem is, I'm getting killed by the quality/memory tradeoff.
I can scale down the dimensions of the textures to reduce the memory footprint, but below a certain resolution the results (especially the normal map) start to look really mushy and terrible. The app needs to be able to zoom at least to where the planet is screen-width, but to maintain any crispness in the mountains and valleys I need to use a PNG normal map (above) at about 6000 x 3000. I can scale the diffuse map way down to about 1000 x 500, but even so, I'm getting periodic memory crashes from a single sphere gently rotating, with a single light, no background, no physics, and no other geometry.
Now, I know that's a super-high-res normal map. I get it. But at the same time, it's just one sphere, doing nothing. That's not even close to some of the complexity I've seen other apps execute flawlessly, even with some pretty detailed textures of their own. It seems like there must be some way of getting high-detail surface textures for a single object, without crashing the app.
So, being a total SceneKit newbie, I'm wondering: are there any tricks for getting good SceneKit texture quality without using ALL the memory in the world? Maybe a way of handling the image textures, re-encoding the files, changing the scene/node settings, etc? Any way at all to get crisp quality with smaller images, or lower memory usage with the same images?
I'd happily quote some code, but right now there isn't much to show. I apply the textures to the SceneKit node the standard way, and it works. I'm just dying from either a lack of memory, or lack of image quality.
Can anyone help me out?
I think the idea is to segment the sphere texture wise so it's only displaying perhaps 60degrees of texture at anyone time, similar to how you display pictures at high resolutions when zooming. I'm not sure how to go about doing that, but that is my guess.