Texture Resolution drastically reduced on iPhone (SOLVED)

Again, thanks for all the help and good advice that I’ve had from this forum.

I’ve got an issue that I’m looking for a place to start from.

I am using a texture from a 1024 x 1024 8 bits per channel jpeg file which is imported into Unity-iPhone using the RGBA Compressed PVRTC 4 bits setting.

This texture is set in the material to:
Offset: 0.00 / 0.00
Tiling: 100.0 / 100.00

In Unity-iPhone, the texture behaves as I’d expect it to:

However, on the iPhone, it looks significantly different:

By looking at the details of the image (blow up to 400% here) you can see better what’s going on:

Unity:

iPhone:

The captures were done using “Grab” to capture off the screen from Unity, and the xCode “screenshot” tab under device, to take the screenshot from the iPhone. Both captures represent what I see on screen.

Can anyone suggest where I should start looking, when trying to solve this problem?

I suspect it’s something to do with the shader you’re using. I’m producing a product which uses a lot of transparency, and I need everything to be double sided, and I’m getting much the same thing using the nature shaders.

If this is the problem, try adjusting the Alpha Cutoff (can’t remember exactly what it’s called, but it’s something like that), as that did help a little.

If it’s not that, I’m afraid I don’t know…! :?

could be the mipmaps, check the import settings and disable mipmaps for all images where you rely on quality (gives a slight slowdown in rendertimes)

it also happened to me, that unity at some point ‘scaled down’ the quality, this usually can be fixed by rightclicking on the image and select reimport

Also don’t forget that the iphone has no anisotropic filtering. So when comparing, did you ensure that you set it to trilinear at maximum, with enabled iphone simulation for the rendering emulation?

Also tiling 100 is pretty heavy.
Can not imagine what type of massive sized object one would use on the iphone, as the impact on the performance isn’t too good. Culling is not done on geometry level so the whole model is sent to the rendering as long as its bounding box is in view.

The iphone is no pc and it will not give you comparable quality. Its an iPHONE
I know that that part might sound stupid or clear but there is a serious common missassumption on what you can do with the iphone and what visual quality you will get.

Dre:

I am pushing selective parts of the device. The main issue I keep an eye on is frame rate and playability. As long as the frame rate stays in the zone for playability, I’ll keep trying to maximize the entertainment value. (And someone already did pong…) I’m keeping a weather eye peeled when looking at my verts and drawcalls, and other performance bench marks.

I am aware of the fact that this is a phone. And a phone with a specific resource budget. I’m just trying to spend my resource budget in a way that will make this game different from others.

This project is completely on other end of the spectrum from Feature Film VFX and I’m aware of that, but I am trying to find where that cliff edge is without a good map.

Currently I’m making a framework and using test objects. Tiling of 100x on a 1024x texture gave me good detail without seeing too much of the repeat. If this doesn’t work, I can reduce the geometry it is on or change the resolution of the tiling.

However, rather than making a matrix or wedge test of assorted geometry densities, geometry sizes, texture sizes and tiling options to try and reduce the current effect, I thought I would ask and see if anyone had any experience in this behaviour before I jumped in.

One of the issues I am trying to avoid is the wait time between levels, and one of the experiments in this direction is to load as much at one time and then vary spawn points, camera positions, objectives and goals so several “levels” of game play are loaded at once in one Unity Scene. One of the drawbacks to this is I need to load a single large playing evnironment. If I can work out these parameters within the limitations of both the iPhone and Unity-iPhone, then I’ll have improved my game play dramatically and made the players experience that much more intense.

Clearly when it comes to existing games, other people have very successfully cracked the resolution, speed and gameplay puzzle, and clearly my current settings don’t attain that standard, but from what I’ve seen in other games (maybe created purely in xCode and not using Unity) they have achieved that standard.

I’ll look into the trilinear settings…

You will have to layout geometry very specific if you want higher detail.
Also using pvr usage automatically means a quality degrade (it cuts 32bit to 4 bit / 2 bit, so obviously there must be visual informations lost)

As for your unity screenshots: Are you sure you enabled the iphone emulation?
otherwise you are using your hardwares abilities, not something that has to do with the iphone, so you are using a magnitudes more powerfull hardwares visual representation.
The iphone render emulation will give you a pretty well representation of what you will see on the device.

The problem with tiling is that it stretches the UV which is not supported nearly as far as you can overdo that on the desktop. The iphone follows the hardware specs much more restrictive (for performance reasons)

Don’t see a problem with your approach of one large level directly.
As you will have to use small sized objects anyway (for frustrum culling to kick in, unity will not cull on geometry level as pointed out above), you should see this issue far less within optimized media assets commonly.

Games on the iphone otherwise use XCode and have technology that was tailored for exactly this usage. They sacrifice many other things you can use as Unity user to do exactly what they do.
Different games available thought can be pretty easily replicated in Unity by talented artists and smart creative programmers.

As for your unity screenshots: Are you sure you enabled the iphone emulation?

Yup! iPhone emulation. Edit/Graphics Emulation/iPhone (right next to [I didn’t ask…] Dinosaur)

The problem with tiling is that it stretches the UV …

I need to dig into UV issues with this. My experience with UV’s is very minimal.

I’ve also removed compression and loaded the texture, from a .png file, into unity using using RGB 16 bit and RGB 24 bit. 16 bit 24 bit did not make a visible difference to the output on screen.

I’ve also experimented with turning off mip maps on the compressed texture, and this made no difference to the loss of detail, and made the texture way to crunchy and grainy.

The texture is also jumping and jittering the value of one iPhone mega-pixel, or large square which seems to be made up of a square of 10x10 actual screen pixels.

This says to me float value issue somewhere, but specifically, I’m not sure where.

I was treating that as a separate issue.

From looking at the graphics closely, it looks like something is dithering a very low bit image into shades by using 10x10 pixel squares BEFORE the image is mapped, as you can see the squares in perspective.

floating issue due to the UV scaling likely.

This is a known restriction on the iphone when overstretching the UV for scaling.
This topic has been brought up in different cases and threads in the past.

Dre:

Thanks again for you help!

I’ve just come off of a fairly thorough and extensive search of the forums using both the Search function and Google. I can’t seem to find any of the threads you are talking about.

Can you be a little more explicit about the limitations or restrictions in the iPhone? Are there specific values or cases you’ve encountered that would be acceptable? If you know of any specific thread, can you point me to it? I’ve even tried to look up the restrictive hardware specs that you’ve mentioned, but I’ve not been able to find anything that translates into the UV limitations.

I know I’m not a technical guru, I’m just trying to find some actual data, or something tangible to work with. Once I get started solving the issue, I can usually take it pretty far for myself.

SOLVED:

It was some sort of corruption of the UV data out of Blender.

Going back to brass tacks, I started rebuilding everything from scratch, and it worked.

SO - then I compared the two bits of geometry and then reassigned the UVs in Blender to the Geometry.

As this was a fairly simple piece, I’d been doing most of my materials work in Unity.

With the reassigned UV data, everything works as expected.