Hello,
I found that specular on iPhone is not highlighting. Specular value is added to diffuse and then clamped to 1:
Clamp01(diffuse + specular) * texture
That is, if diffuse is 1, I see no specular highlight, even the texture is black. Is this normal on iPhone?
Thanks,
Man
Specular highlight on iPhone
-
masterfalcon
- OGRE Retired Team Member

- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Specular highlight on iPhone
Could you give more information about how to reproduce this? Also, is this GL ES 1 or 2?
-
mannam
- Halfling
- Posts: 45
- Joined: Tue Feb 15, 2011 7:23 am
Re: Specular highlight on iPhone
Sorry forgot to mention.
I build it from 1.7.3 source, should be GLES 1.
Thanks,
Man
I build it from 1.7.3 source, should be GLES 1.
Thanks,
Man
-
masterfalcon
- OGRE Retired Team Member

- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Specular highlight on iPhone
You forgot the "how to reproduce" part. what is your material? what are you doing to the material in code? etc.
-
mannam
- Halfling
- Posts: 45
- Joined: Tue Feb 15, 2011 7:23 am
Re: Specular highlight on iPhone
It's quite straightforward:
In coding, I add a directional light with white specular:
The problem is only on iPhone. In PC, the specular is correct.
Code: Select all
material Outside_Mat
{
technique
{
pass
{
ambient 1 1 1 1
diffuse 1 1 1 1
specular 1 1 1 1 50
emissive 0 0 0
texture_unit
{
texture texture.png
tex_coord_set 0
colour_op modulate
mipmap_bias -2
scale 1 1
scroll 0 0
rotate 0
}
}
}
}Code: Select all
mLight = sceneManager->createLight("Light");
mLight->setType(Light::LT_DIRECTIONAL);
mLight->setSpecularColour(1, 1, 1);-
masterfalcon
- OGRE Retired Team Member

- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Specular highlight on iPhone
Thanks. I've confirmed this on GL ES 1. I'll let you know what I find out.
-
warmi
- Gnoll
- Posts: 674
- Joined: Sun May 27, 2007 3:56 am
- Location: USA
Re: Specular highlight on iPhone
Specular will never work properly with GLES 1 when using texturing, because GLES 1.x lacks GL_SEPARATE_SPECULAR_COLOR.masterfalcon wrote:Thanks. I've confirmed this on GL ES 1. I'll let you know what I find out.
-
masterfalcon
- OGRE Retired Team Member

- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Specular highlight on iPhone
Agreed. That's exactly what I was seeing once I started looking into it.
-
mannam
- Halfling
- Posts: 45
- Joined: Tue Feb 15, 2011 7:23 am
Re: Specular highlight on iPhone
Understood, thanks.
Man
Man