Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is the specular shader broken on iOS?

Discussion in 'Editor & General Support' started by MvD, Mar 9, 2011.

  1. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
    Hi, when I create a test project that shows a simple sphere with a highlight, it looks very different on iOS. It seems that on iOS, the intensity of the directional light I use is ignored. When the intensity is set to 0, the editor and iOS look the same, but any intensity above that, the iOS version looks roughly the same (the diffuse colour changes), and the editor version changes correctly with light intensity. I think I recall this problem was not present in Unity 3.0
     
  2. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you explicitely comment that its the windows editor, as such I don't see how its related to iOS as iOS is osx only.
    also what graphics emulation is active in the editor?
    Generally there is nothing that can fully emulate the look of the device as far as I'm aware not even Imagination Technologies PowerVR simulator does it to 100% (but its definitely the closest thing to "as on the device")
     
  4. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
    Hi Dreamora, the iMac editor shows exactly the same colours as the windows editor (when I switch graphics emulation modes on the iMac, nothing changes in the appearance of the sphere). The difference between iOS and iMac editor / Windows editor is quite big...
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    So you:
    1. Switched the project to be an iOS one once you were on OSX
    2. Switched the materials shader to a mobile one if possible
    3. You then went to graphics simulation and enabled OpenGL ES 2.0 emulation?

    if you don't use ES2.0 it will look seriously different as the specularity then is per vertex, no per pixel effect any longer. to handle that fine for both cases, ES 2.0 and ES 1.1 you would need to write shaders that fallback appropriately and that result in a corresponding look, given the current mobile ones don't fullfill your needs
     
  6. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
    Yes, I don't think there's a mobile 'specular', and yes. You're right that when you switch emulation to OpenGL ES 1.1, the specular is suddenly per vertex: you completely lose the per-pixel specular that uses the alpha channel of the texture as a gloss parameter. You can see in the screengrabs that on iOS (in this case an iPad), specular is still done per-pixel, and the gloss effect is also visible.