Hi all,
I have an existing iPhone project with Unity 2.x. I recently upgraded the project to Unity 3.1, and am finding some surprising differences with the new project.
-
lighting is quite different on a number of my objects as if the shaders are behaving differently now. I’m just using the iPhone standard shader assets, and can’t seem to find any thing obviously different in the setup with the Materials, etc… Has anyone experienced something similar? Any tricks to making a successful upgrade or troubleshooting issues like this?
-
deployment to iPhone4 is quite different from the previous builds and unexpected in terms of GUI elements. I’m finding that in 2.x, the basic layout was the same between iphone3g and iphone4. As with coding in objectivec, GUI elements were scaled with a 480x320 dimension, just with a double pixel density. However with Unity 3.1, GUI elements seem to want different dimensions, and I’m seeing layouts that look as if they are deployed on the iPad, not simply a double pixel iphone4. Similar to above, I know this is a broad question, but are others experiencing things like this and are there any hints as to where to look to troubleshoot this?
Thanks in advance!
great - thanks again for this feedback, I will check that out. I’m actually seeing the lighting change in the Unity Game view. Do you know if this this a clue that my setup isn’t quite right?
Oh you talk about the game view?
Well there its a whole different story, cause the emulation is much better than it was on Unity iPhone 1.x
Ensure to see which graphics emulation you use in your iOS project at the time
Yeah, I did investigate that and all the iphone emulator settings yield the same result. My problem with the lighting is both in the emulator and on the device.
I was able to resolve my original question #2 - or at least replicate what I was seeing in Unity 2.6 by setting the resolution to low/medium.
However, I’m still running into some issues with the lighting/shaders. I haven’t changed code or lighting settings, I have a torus object with a diffuse/detail shader. In Unity 2.6, I could see the contours of the torus, with nice lighting as it rotated around. The edges of the object look smooth and round. In Unity 3.1, the object is very flat, and as it rotates the lighting will jump from light to dark. The edges are badly aliased. This behavior is consistent in both the emulator and on the device.
I am now using the ‘Mobile/Diffuse Detail’ shader rather than the previous ‘iPhone/Diffuse Detail’ shader just to be sure that there wasn’t a conflict.
Has anyone else seen this sort of issue in an upgrade? Any pointers to what I should investigate? I’ve not had any luck with this after several days of tweaking. I suspect that there is some simple setting that I’m missing, but it’s frustrating.
There is no such thing as unity iphone 2.6 actually
There was unity iphone 1.7 and there is 3.0, but no 2.x version (unity iphone 1.x was branched out from the 2.1 desktop version, not 2.5+)
unless you really talk about the desktop one here but there such drastic changes from smooth to aliased is to expect. But unity iphone never supported anti alias so I don’t see how this behavior should have changed from 1.7 to 3.x
I’m sure you’re right about the version numbers, and sorry for the confusion. Prior to my recent upgrade to 3.1, I have been using Unity Pro and Unity iPhone Pro. I understand that iphone doesn’t support anti aliasing, and I’m just trying to be more specific about what I’m seeing in terms of the degradation in graphics quality.
Regardless, the ‘flatness’ of the lighting on the torus and the fact that as it rotates the lighting behaves in a different and unexpected way are the key problems. Somehow I guess it’s also just drawing my eye to the fact that there is aliasing, but you’re correct that this isn’t the problem. It’s the lighting behavior that is definitely different.
To be clear, I am not migrating from desktop to iPhone. I am going from the previous version of Unity/iPhone Pro to the 3.1 version of Unity/iPhone Pro.
Just in case anyone stumbles across this thread in the future, just wanted to post that I was able to narrow in on the problem with the lighting posting a new thread here: http://forum.unity3d.com/threads/71302-Mesh-lighting-discrepancy?p=455829#post455829
turns out that when my model was imported after the upgrade to 3.1, the normals were being ‘calculated’ rather than ‘imported’ I adjusted this setting, reimported and now the lighting is back on track.
dreamora, many thanks for your feedback that ultimately helped to identify the actual problem I was having. much appreciated!
glad you could solve it 
U3 indeed has some changed behaviors, among those there is also the case where you build for armv6 + armv7 and don’t disable opengl es 2.0 through the define in AppController.mm for example where lighting will change drastically cause its then per pixel