iOS 12 Model rendering issue - ios

Having an iOS 12 model rending issue.
My app loads OBJ models with associated MTLs and textures.
On iOS 11 we were able to load up the models and they looked good:
On iOS 12, they look completely different:
We are able to make some changes after the model loads initially to make it look good, but it takes time for the iPhone to load the better looking version.
Has anyone heard about/experienced this issue and know what has changed in iOS 12 (and potentially MacOS Mojave) that is causing it?
There might be two issues: 1- texture issue (as seen in chair on left) and 2- Material/MTL issue as seen in the ‘delivery drone’ on the right
I don't have any code at this moment as I am not one of the developers on the project - I have been tasked with reaching out here. If you have any questions regarding the specific code I could definitely try to get some to show here. It seems to me like this might not be a code issue or bug, but rather some settings that have to changed due to changes made in iOS 12, but I can't find documentation for something that matches this.

I know this is not an answer, but I was asked for a screenshot. For the moment I use the OpenGL renderer instead of Metal as a workaround.

I solve the same issue by convert .obj file to .scn files in Xcode, and use this scenes as nodes. Editor -> Convert to SceneKit file format (.scn)
screenshot of this menu

Related

Getting Master-Detail App Template from Xcode 11?

For learning reason, I would like to get back the Master-Detail App template that was available in Xcode 11 and refer to the template codes inside. I also want both the Swift and Objective-C versions. However, to my astonishment it seems no one has asked this question before and seems there were no data source available where I could get back those files.
I try to reinstall my Xcode 12 back to Xcode 11 but that was not allowed as Mac complained that I am using Big Sur and I cannot use Xcode 11 with Big Sur. I also tried to check on YouTube etc. to look for potential useful information about Master Detail App and those existed on YouTube were from Xcode 5 or Xcode 6 or so where the split view controller thing were not in used yet.
I saw a reply online saying Master-Detail App is replaced with simply App and so we can just use App instead from there. That answer is of course factual but practically useless. As that answer assumed readers are pro enough to change between different templates, but if that's the case then readers like I won't need to ask that question in the first place. Readers look for that particular template for a reason, simply telling them to use something different is tautology.
In short, I cannot come up with a way to get back the exact Xcode 11 Master-Detail App template and I really need it for learning purpose. Is there something I can do with it?
You can search for tutorials (video or article) that uses Xcode 11 and get it from there.

Unity 3d model fragmented on mobile

I have a strange issue that keeps coming up in Unity 2018.2.15f1 (personal). The best way to describe it is that my 3D models are fragmenting (exploding? shattering?) when I build to iOS. So, I'll start with a visual explanation. This is what the model looks like on an iPad
and this is what it should look like (you can also see it on the App Store w/o fragmenting):
These models came from OSM terrain data, worked on in Blender, and then imported to Unity. They worked fine on mobile builds up until one of two things happened while trying to increase performance 1) I experimented with mobile shaders and 2) I followed some of the tips in this video. Since discovering the issue I "undid" all the changes (using Git this was easy) and it seemed to fix it, until many versions later the problem has suddenly showed up again, but only on this one model (not the other two "cities"). I assumed the issue was the switch to mobile shaders, but since I'm not using them any long I now have no idea what is causing the issue.
Here's what I've done to try to fix it:
Reimported the model
Broken the model into distinct components (buildings and terrain)
Double checked I have default Quality settings (under Project Settings)
Double checked I use only the Standard Unity shader throughout the game
I have found if I turn off one or the other of two models in the scene (the buildings and terrain) the issue goes away.
I have found if I position the building model so they don't intersect (see #5) it works sometimes but not every time. It must be at least 30 units above the terrain on the Y axis before the fragments go away.
I tried writing over the iOS build folder (instead of append) but that had no effect.
I tried switching to PC standalone, resetting the GI Cache in Preferences, and switching back to iOS but no luck.
I have found the a solution, but I don't know why. I separated the meshes into separate objects AND gave each a different material, with matching settings except for one option.
On the new one, I changed the Rendering Mode from Opaque to Transparent. Now there is no more fragmenting, but I'm not sure why. Leaving this question open until someone knows the answer.

What's wrong with this aupreset for AUSampler?

I created this aupreset to be loaded into an AUSampler in iOS. I followed the process outlined here and used the EPSSampler class for the same post. So, if I run my app in the iOS simulator, on iOS 9, the aupreset loads and I get to play notes. If I run the same app on a device running iOS 6, the preset loads but I get no sound. I have used the same process on simulator and device in the past, but always by filtering the built-in sine wave generator, never with audio samples. Can someone spot what I'm doing wrong?
EDIT I have no way of testing the app on any device running iOS above 6, at least for now.
EDIT 2 To clarify further, this is how my project looks in Xcode, so you know that my files are going to the right places – i.e. the audio files are going to the Sounds folder within the app bundle (I double checked, just to be sure).
EDIT 3 So, I took the Trombone.aupreset from LoadPresetDemo and manually plugged my audio files into it. Magically, it worked. So I figured I'd load it into the AUSampler's GUI through AU Lab, and make whatever changes I needed to make it sound right – i.e., increasing the release time. It stopped working. So, i manually tweaked the working copy to roughly match what I needed (the docs on aupresets plists are surprisingly unhelpful) and I'm rolling with it. It would seem that AUSampler is messing up the preset, at least for iOS 6 on device, which, currently, is the only device I have to test on. Insights?
I didn't really look that deeply, but the file://localhost//Library/Audio/Sounds/C.caf in your file references looks a little fishy. Mine looks like this /Users/dave/Library/Audio/Sounds/C6.wav. Maybe the file:// part is throwing it off.
Create a directory in your iOS project named Sounds (just like your image shows) and put your caf files in there. The URLs will be groked by iOS.
Here is a post that goes into detail.

How to get SKAction(name:) to work reliably?

I've been working through the DemoBots example and having a lot of trouble getting it to work on all devices.
https://developer.apple.com/library/prerelease/ios/samplecode/DemoBots/Introduction/Intro.html
The current problem I'm having is that on an iPad Mini the app launches but crashes when loading animations. It crashes in AnimationComponent.swift on the line that loads an action from a file:
let bodyAction: SKAction?
if let name = bodyActionName {
// crash here
bodyAction = SKAction(named: name)
}
else {
bodyAction = nil
}
Debugging the app reveals that its trying to load an SKAction called "ZappedShake" but crashing with an array out of bounds exception.
On an iPhone 5S it runs fine. My best guess is its race condition with the faster iPhone 5S is loading the file with the action serialized in it, and by the time execution reaches this point the action is available. But on the single core older iPad the file is not yet loaded and the call fails.
Both are real hardware running iOS9 13A4325c, compiled on XCode Version 7.0 beta 4 (7A165t).
Making the problem more difficult is that I can't see where the file that apparently creates the "ZappedShake" - ReferenceActions.sks - is actually loaded. Its referred to by ReferenceScene.sks but nowhere in any of the code or anywhere else in the project can I see that file being referred to.
Is there some sort of name convention magical file loading mechanism for SKActions? Why does it work on the iPhone 5S and not on the iPad?
UPDATE: Found more on this here: http://asciiwwdc.com/2015/sessions/604
Also this year we focused on referencing and instancing.
We know you spend a lot of time designing high-quality content and animations for your games and we want you to let you reuse that content anywhere where you would like to.
We're allowing you to create serialized data files for your nodes and your actions and then add them as a reference instead of just loading them into your scene.
This way, every time you make a change to the source asset that is automatically reflected in the content of your game.
How do I do this for nodes? For nodes I design part of my scene, maybe a background element, or some scenery in our editor with an Xcode and then I can just drag-and-drop those files into my main scene in Xcode and it will automatically create a reference and it is all set up for you.
If you want to do this in code you can as well, you can manually construct an SKReferenceNode, assign it a file name or even a URL and when that content is first presented in your game we'll load in that content based on the latest version of the file that's in your bundle.
We can also do the same thing for actions. With actions go check out our great new action editor and beyond creating and composing the actions in Xcode you can give all them names.
These names are the key to using them in your game. We have added a selector to SKAction called actionNamed. This works just like it does for SKTexture and textureNamed.
You pass in the name of the action you want. We're going to automatically look inside of your app bundle in all of the serialized action files, find the one with the appropriate name and then surface that to the application.
This looks great but I can't find any documentation on it, or figure out how to debug it when it goes wrong.
It's not you, it's iOS. There's a bug with action references affecting 32-bit devices (like the iPad Mini.)
This issue has been fixed in iOS 9.2 Beta 1, according to this thread on the Apple developer's forum:
https://forums.developer.apple.com/thread/17267
Try running on a more recent 64-bit device (like iPhone 6) in the simulator. Or try upgrading your iPad Mini to iOS 9.2 Beta 1. Or just wait for the next iOS release to fix the problem.
The DemoBots game seems to run reliably when compiled with Xcode Version 7.0 beta 6 (7A192o).
Using a different machine (my home laptop) with a fresh install of Xcode the problem goes away. I also note that the first time I tried there were a few minor compile fixes I had to do such as renaming CGPoint.zero to CGPoint.zeroPoint which I guess should have sounded warning bells that there was some sort of version conflict. This time with the fresh install it compiled and ran out of the box.
I still don't completely understand how the reference actions are getting picked up but at least I now have multiple working versions of Demobots so I can just duplicate the working code there.

GPUImage examples not working

I've hit a roadblock with using GPUImage. I'm trying to apply a filter (SepiaFilter or OpacityFilter) on a prerecorded video. What I'm expecting to see is the video played back with the filter applied to it. I followed the SimpleFileVideoFilter example for my code. What I ended up with is a video that is unplayable by Quicktime (m4v extension) and the live preview of the rendering all skewed. I thought it was my code at first so I ran the example app from the examples directory and lo and behold I got the same issue. Is the library broken? I just refreshed from master out of GitHub.
Thanks!
Here's a sample output of the video generated
http://youtu.be/SDb9GfVf9Lc
No matter what filter is applied the resultant video are all similar. (all skewed )
#Brad Larson (I hope you see this message), do you know what I can be doing wrong? I am using the latest XCode and source code of GPUImage. I also tried using the latest from CocoaPods as well. Both end up the same.
I assume you're trying to run this example via the Simulator. Movie playback in the Simulator has been broken for as long as I can remember. You need to run this on an actual device to get movie playback to work.
Unfortunately, one of the recent pull requests that I brought in appears to have introduced some crashing bugs even there, and I may need to revert those changes and figure out what went wrong. Even that's not an iOS version thing, it's a particular bug with a recent code addition. I haven't had the time to dig into it and fix it, though.

Resources