I’m trying to adjust a shader, but i’m curious why it does not render the same on iOS (make it less easy to tweak).
What am i doing wrong ?
My problem is somewhere near the specular power… so the light is too hard on iOs version.
The specular is filtered via the alpha component of _MainTex (pure grey here)
Sure, this is a quick and dirty version because i’m not allowed to show the reals assets.
My problem is in the light reaction… it’s smooth on pc/mac side, and it quickly burn white on iOs.
May be it’s not enough visible here, but for sure the reaction is different from a platform to another, and this sound strange no ?
Different platform, different gpu, different compression, different rendering paths → potentially different outcome.
In this case it could be something as simple as the choosen texture compression (desktop is DXT5NM, which is a format especially for normal maps, on mobiles there is no NM format so if you choose compressed you can easily achieve serious differences) but it could also be related to the light type and distance itself or the choosen precision within the shader code which makes a major difference on the resulting calculation.
As you feed the alpha channel for specularity though chances are very high that it is simply the texture compression which is much more destructive on mobile than desktop (DXTC / S3TC vs PVRTC), thats why daniel recommended comparing it without any texture compression, in case of specularity on the diffuse texture, to see if its really different or simply a consequence of compression artifacts
Ok thanks for the clarification (and thanks daniel for the first input). I’ll check without any compression on both sides.
But i’m quite sure it’s a difference in specular computation (shader precision or so…).
It must be a hard work, behind the curtain, to get same results on different platforms, but i think it’s part of Unity’s goal.
For now i’ll assume i need different shaders/parameters.
I’m pretty sure its specular too, thus the part on the ‘diffuse alpha → specular → check diffuse texture compression’ as PVRTC alpha compression is very destructive on the precision (smooth gradients on it is a thing that is potentially possible on Unity 3.5, but not 3.4.2 and earlier)
Switching to uncompressed texture did not changed a lot… for sure it look better, but the light problem was the same.
After many tweaks, i’ve altered the specular computation in LightingSimpleSpecular to limit it’s value.
float spec = pow (nh, _SpecPower);
became
float spec = min( 0.8, pow (nh, _SpecPower));
it’s not a perfect solution, but it’s an acceptable result for my goal.