I’m having a problem with my custom shader in that it works perfectly in the unity editor, but then performs poorly on the iPad. Specifically, the shader in question is for hair, and incorporates a specular reflection, diffuse reflection and normal mapping. When i spin the character’s head around, the back of the hair doesn’t look right. However, while focused on the back of the head, if I recolor the hair, the problem goes away, and the hair looks overall lighter. I cannot recreate this in the Unity editor, because it looks the same no matter what angle I redraw the hair at. I’ve attached a couple screenshots to illustrate the issue. The three pictures are the back of the head in the editor, the initial back of the head on the iPad, and the back of the head on the ipad after recoloring the hair.
Any help is appreciated, thanks.
Initial back of the head on the iPad before recoloring the hair
I have no idea what you do when “recoloring” but usually differences between Editor and Device are caused by:
precision (on pre iPhone 5S / iPad air devices lowp is in range -2 +2) - try to set everything to float/highp for a test.
auto normalization - use #pragma glsl_no_auto_normalization to turn that off
iPhone 5 / 5C (possibly iPad 4?) the GPU of these devices has some bugs.
beside that I had issues since the new shader compilation was introduced - take a look on the shader in inspector if it shows errors and reimport it. (but this is possibly just my personal voodoo)
Then the ipad and editor versions look the same. They don’t look very good (way too dark and colors are off), but at least they look the same. am, I doing something wrong here with the diffuse reflection?