Hey,
how does normalmaps work on android?
If I set my texture with normalmap flag it shows wrong ( left image ), it I set it to texture it looks right ( right image ), but still shows wrong on the model. I tried with my own shaders and also unity’s basic shaders like mobile/bumped specular but it looks completely broken. works fine in PC/Mac mode but gets broken as soon as I switch to android.
Cannot confirm, have worked with normal-maps and Android for months just fine. I’m seeing another difference in the above shots, left one is compressed, right one isn’t. Have you tried a number of other normal maps? Maybe this map is a one-off “weird case”…
The files are in .tga format.
I use the UnpackNormals function in my shader. I also tried the defaults unity shaders and does not work either. I’m wondering if it has something to do with my android SDK? does unity use it for texture compression or something?
Ok. I can confirm this. Works fine in Desktop, is broken on mobile (Android/iOS/Blackberry).
I’m using a default bumped diffuse shader. Tried all the options for texture importer. As soon as you convert it to Normal map, it gets this “pink” color instead of being blueish.
The only workaround I found is to edit the normal map in photoshop, swap channels so the original Red channel ends up in the Alpha channel, and save it as TGA for example.
I’m pretty sure that’s not the expected behavior, as it didn’t work like that before. Also, this channel swapping is something that Unity needs to do internally, and not something we need to take care of.
I’m glad that I’m not the only one with this issue, however we’re making a multiplatform game I cannot have 2 sets of normal maps for every model… Is there a better way to submit a bug other than from the menu in unity? because I never got any response from committing a bug from there…
Most likely this is a known editor bug that we’re working on already.
The corrupt-looking normal maps should work ok on the actual mobile devices. The editor just displays them incorrectly on DX11 mode.
As a workaround, try disabling DX11 from the PC player settings → “Use Direct3D 11”
However, do let us know if this doesn’t help or if there are faulty results also on the actual HW.
Yeah, that fixed it!
I’m glad you’re aware of this issue and that it’s being fixed.
I think it would be a good idea to post the known bugs somewhere and also post the workarounds you know of.
If not on the forums, then at least update the issue tracker to state that you’re working on a fix, and that there is a temporary workaround. Might save someone else a few hours figuring out what the hell is going on and submitting a bug that UT still has to analyze.
Thanks!