Mipmap bias not Set on device with Unity 3.4 IOS project

In Unity 3.3 I used the following code to set the mipmap bias at runtime.

public Texture[] textures;
public float bias = -2.0f;

void Start ()
{
    foreach (Texture t in textures) {
       t.wrapMode = TextureWrapMode.Repeat;
       t.filterMode = FilterMode.Bilinear;
       t.mipMapBias = bias;


    }   
}

In Unity 3.4 everything looks ok inside the editor but the bias is not set on my IOS devices. Is there something changed in version 3.4 that I overlooked inside the Unity scripting reference manual?

Peter.

I don’t know about this bug, and am interested to know what the problem is. In the meantime, have you tried setting it on the Importers instead? That sounds like what you actually want.

Jessy,

I found your post on Unity Answers: Link (Nice addition for my script library :wink: ) It works great inside the editor but has also no results on the device.

I already tried:

Switch OpenGL ES modes
Normal diffuse shaders instead of Mobile diffuse shaders
Enable 32 bit mode inside the player preferences
A fresh IOS project build.

I’m working since a few weeks with Lion OSX. The project builds fine but maybe There are some incompatibilities?

Peter.

removed until further investigations done

dreamora,

I lost you :slight_smile: Please clarify about extensions and min or mag filters.

Peter.

removed until further investigations done

Ok,

But this script always worked perfectly on IOS until Unity 3.4. I also tested somewhat further and noticed that the ansio level is also not set on the device. That should be still possible?

Peter.

hmm okey

Well it works fine now too, it just has no impact.

Can’t comment on aniso but I recall having seen threads on the matter already

I submitted a bug rapport and gave as reference this thread: Case 418071

Lets hope that it will be solved soon.

Peter.

I found the problem. It is the new mobile diffuse shader. After switching it back to something else like vertex colored the mipmap bias behaves correct.

Peter.

Yes, our main menu GUI is all 3D Objects for resolution independence, Looked very sharp in 3.4, however after our update to 3.5, it looks blurry. We have to turn mipmaps off to make it look good again. Yes I know we should have done this to start with, but its our first app and so many things to learn.
It uses the Mobile/Particles/Alpha Blended material. Could it be something to do with all Mobile shaders and unity 3.5

Also unit 3.5 has mention of bias and lod in quality settings where 3.4 didn’t?

Jethro.

I was having a similar issue, with mipmap-enabled textures being blurry on iOS. The solution (at least to my particular problem) ended up being elsewhere: it looks like by default the Quality Settings (Edit > Project Settings > Quality) for all platforms is set to “Fastest” which sets the Texture Quality to “Half Res”. Changing this to “Full Res” or picking a different quality level seems to fix the problem. I believe the mipmap bias still works, it’s just that the the “Half Res” setting it can only get as large as half the size of the original texture.

Now why the problem doesn’t also happen on PC, or textures that don’t have mipmap enabled, I really don’t know/ But if you are still running into this problem give it a try.

As far as I know, MipMap bias is not supported on iOS, due to OpenGL ES 1.1 and 2.0 limitations. I had a short convo on Twitter with Aras Pranckevičius (he works at UT), and turned out to be this way…

Mine eyes must be deceiving me, because I’ve been using MipMap bias with iPhone for the past two years. Unless it’s not working the way it should and I’ve just not noticed? Not just with Unity apps, but our own code too.

I’ll have to check this out (don’t want to break any old projects…)