Simple material renders differently on simulator and device

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm

Simple material renders differently on simulator and device

Post by simedj » Mon Dec 10, 2012 1:14 pm

For some reason my whitish skeleton renders a weird yellow color on my iPad, but works fine on the simulator. Also, lighting appears messed up:
Screen Shot 2012-12-10 at 12.02.53.png
Simulator
Screen Shot 2012-12-10 at 12.02.53.png (51.1 KiB) Viewed 1137 times
Screen Shot 2012-12-10 at 12.02.54.png
iPad 2
Screen Shot 2012-12-10 at 12.02.54.png (72.5 KiB) Viewed 1137 times
The material is just a dead-simple fixed-function one, fed into RTSS:

Code: Select all

material MatSkull
{
	technique
	{
		pass
		{
			ambient 0.34902 0.34902 0.34902 1
			diffuse 0.631373 0.631373 0.631373 1
			specular 0.31 0.31 0.31 1 25

			texture_unit
			{
				texture skull_diffuse.jpg
			}
		}

	}
}
skull_diffuse.jpg is a simple 512x512 image.

This problem has always been present from XCode 3 / iOS4 through XCode 4.5/iOS6. I imagine it's something simple, but I don't know where to look - suggestions please!
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

mannam
Halfling
Posts: 45
Joined: Tue Feb 15, 2011 7:23 am

Re: Simple material renders differently on simulator and dev

Post by mannam » Wed Dec 12, 2012 4:24 am

Is skull_diffuse.jpg in power-of-2 dimension?
0 x

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm

Re: Simple material renders differently on simulator and dev

Post by simedj » Wed Dec 12, 2012 9:43 am

skull_diffuse.jpg is a simple 512x512 image.
I might try testing without the texture in the material though, to see if that is the problem.
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

mannam
Halfling
Posts: 45
Joined: Tue Feb 15, 2011 7:23 am

Re: Simple material renders differently on simulator and dev

Post by mannam » Wed Dec 12, 2012 10:52 am

It looks like texture error. Ogre "sometimes" show yellow+black colour on texture loading error.

You may also check if there is another file named skull_diffuse.jpg in other directory.
0 x

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm

Re: Simple material renders differently on simulator and dev

Post by simedj » Sun Jan 13, 2013 10:45 pm

OK I got round to re-testing this on the device through XCode and got this in the logging for several textures:
Error loading texture skeleton_diffuse.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource skeleton_diffuse.jpg in resource group General or any other group.
Since it runs on the simulator, I'm wondering how the file is missing... or if perhaps the file is there but not loading instead?

Is there an easy way to view the contents of the application package which has been installed on the device... it seems the copy produced by XCode on disk is correct.
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: Simple material renders differently on simulator and dev

Post by masterfalcon » Mon Jan 14, 2013 9:26 am

Check the case. By default OS X uses a case insensitive filesystem but on iOS it's the opposite.
0 x

Post Reply