materials are fine on PC but not on iPhone

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

materials are fine on PC but not on iPhone

Post by dowi »

hi

i have a car model that i exported with ogreMax and i manually fixed the windows materials to be transparent.

that works on the PC - i see my car very good in Ogre Meshy for example
but on the iphone the windows are not transparent!

from ogre meshy:
Image

and from the iphone:
Image

i tried 2 ways to make a material transparent:

1.

Code: Select all

scene_blend alpha_blend
depth_write off
texture_unit
{
	alpha_op_ex source1 src_manual src_current 0.1
}
2.

Code: Select all

scene_blend one_minus_src_colour dest_colour
depth_write off
whats weird is that i had several other models and it worked also on the iphone.

what could be the problem?
again, it works on the pc, but not on the iphone : (

thanks alot!
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: materials are fine on PC but not on iPhone

Post by masterfalcon »

Is this GL ES 1 or 2? Also, you mentioned that you have several other models that work fine. Are they using the same or similar material?
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

Re: materials are fine on PC but not on iPhone

Post by dowi »

sorry for not mentioning the details..

using gl es 1.1
and yes, i have other models that works well with the first way of transparency
but after viewing this model and than viewing them they also got the same problem of non transparency.

i now tried setting the material to full transparency (which is unwanted..) and it is transparent from one side but not from the other side:

iphone:
Image

and now it is not good even with ogre meshy:
Image
it has this white background..


the full material is:

Code: Select all

material Glass
{
	technique
	{
		pass
		{
			ambient 0.588235 0.588235 0.588235 1
			diffuse 0.588235 0.588235 0.588235 1
			specular 1 1 1 1 42
			
			scene_blend zero
			depth_write off
			
			cull_hardware none
			cull_software none
		}

	}

}
and i tried also without the last two lines..

thanks alot for the help!
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: materials are fine on PC but not on iPhone

Post by masterfalcon »

Sounds like it must be something else if it's not working in Meshy too.
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

Re: materials are fine on PC but not on iPhone

Post by dowi »

hi,


but before i tried setting
"scene_blend zero"

the problem was only in iphone : - \
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: materials are fine on PC but not on iPhone

Post by masterfalcon »

You don't happen to see anything like

Code: Select all

scene_blend does not support "zero" for argument 1
in your log for that material do you?

I think the problem is that you're missing an argument to scene_blend.
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

Re: materials are fine on PC but not on iPhone

Post by dowi »

masterfalcon,

you were right about the zero,
but i dont want to zero the scene_blend. i just tried it..

what i want is for a material to be partialy transparent
and as i understand the next is valid or has worked for me before:

Code: Select all

scene_blend alpha_blend
depth_write off
texture_unit
{
   alpha_op_ex source1 src_manual src_current 0.1
}

now i have a model that is transparent in ogre meshy but not on the iphone.

any thoughts please?
dowi
Halfling
Posts: 48
Joined: Wed Sep 07, 2011 3:37 am

Re: materials are fine on PC but not on iPhone

Post by dowi »

OK, problem solved

even though it worked on the pc, on the iphone i change the alpha of the ambient and diffuse
to less than one and now it is working on my iPod.

thanks for the help!