Home Unity

Unity > android. Different normal calculations?

polycounter lvl 14
Offline / Send Message
fatihG_ polycounter lvl 14
Hey guys,

So I have a couple of android devices laying around. Figured I might as well try to make some sort of "portfolio" app. Basically want to create a bunch of turnarounds and display them in the app.

Now I got this working fine for a test case. I've got a turnaround of a character (much like the one in my portfolio). But I noticed the normals look a tad off in the android version, tested it on a Samsung Galaxy Note (phone, N7000) and a Samsung Galaxy Note 10.1 (tablet, N8100 or something).

This seems to only be the case in the android versions. The normals are matched perfectly to Unity (using farfarers xNormal plug-in thingy).
Using the web player displays the normals just fine. The "game" view displays them correctly as well.

I was wondering if anyone knew of this or had a fix for it. Or will I just have to deal with it?

I was planning on taking my tablet with me for a potential job interview so I could show things in real-time. But having these normal errors could possible show that my normal mapping knowledge isn't that great.. Which sucks ass, as I think my knowledge of normals is pretty decent. (Maybe I could use this as an opportunity to show them I do understand why the artefacts are happening and score some imaginary points?)

Anyway, if anyone knows about this and has a potential fix, please let me know.

Thanks.

Replies

  • Brendan
    Offline / Send Message
    Brendan polycounter lvl 8
    Check the normal map texture input settings, I only did a bit of droid developing, but they have different compression methods. With PC builds it should default to a DDS DXTNM compressed file, with the mobile versions of Unity sometimes it will go to some crazy mobile format that maybe isn't as good.


    Also check the shader; try it with a non-mobile bumped shader and see if that makes a difference. It'll be slower, but probably not by a whole lot, and if they're taking shortcuts in the shader for mobile performance they're not going to help you show off your work anyway.
  • fatihG_
    Offline / Send Message
    fatihG_ polycounter lvl 14
    Hey cheers,

    Ill have to take a look at the texture compression settings.

    I use a custom shader made with Strumpy's, so I don't think its some funky shader magic messing it up.

    Thanks
  • Farfarer
    The normal maps are different for different platforms. Automatically handled by the UnpackNormals function.

    For desktop, it's DXT5nm, swizzling G and A channels and deleting the B channel. It's then reconstructed in the shader.

    For mobile, it's stored as RGB, and simply re-expanded to -1...1 range in the shader.

    Could be your normal maps aren't normalised? That would create a difference, as the reconstruction will give a normalised result and will only look the same as your texture if you normalise it.
  • fatihG_
    Offline / Send Message
    fatihG_ polycounter lvl 14
    I don't recall messing with the normal maps, other than merging multiple bakes.
    So unless the bakes aren't normalized (I thought we only had to do this whenoverlaying multiple normal maps), I dont think it would change much,
    Will try normalizing them though, see what that does.


    Cheers.

    edit-

    Just tried, normalizing my normals doesnt do much. Same stuff happens.

    Could it be that Unity changes the import settings? Like mesh compressions, tangents, normals and what not?

    edit deux-

    Tried a bunch of different fbx settings, (smoothing groups, tangents/binormals, split verteces, etc.) and tried different import settings. Couldn't figure it out.
    I am marking this as a "deal with it" issue.
  • Farfarer
    Don't think so. Any screengrabs of the issues?
  • fatihG_
    Offline / Send Message
    fatihG_ polycounter lvl 14
    Hey there, I am not supposed to show this model to anyone yet due to NDA.

    Is it ok if I PM the trouble areas to you?
  • Farfarer
    Sure, no probs.

    Can email them if that's easier - jamesohare@gmail.com
Sign In or Register to comment.