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

Normal maps on Mobile, 2022. OK for performance?

Discussion in 'General Discussion' started by cpuRunningHot, Jun 10, 2022.

  1. cpuRunningHot

    cpuRunningHot

    Joined:
    May 5, 2018
    Posts:
    94
    Heya peeps. Just wondering what the general consensus is on using normal maps for mobile ( iOS and Android ) for a medcore/hardcore game in 2022 is? Is the performance acceptable 90%+ of phones that would be used by a modern mobile gamer ( excluding casual market with grandma phones :D )?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,799
    "Medcore/hardcore" does not mean anything in technical terms. As with all things, do some benchmarking based on your own performance requirements.
     
  3. cpuRunningHot

    cpuRunningHot

    Joined:
    May 5, 2018
    Posts:
    94
    "Medcore/hardcore" is relevant since players of a certain genres are more/less likely to have modern hardware.
     
    useraccount1 likes this.
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    You can download some of the popular games similar and see how they go about it.
     
  5. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,799
    No, it really isn't. None of this describes anything useful about your game's technical requirements.

     
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,184
    Just include them and enable/disable based off of the performance of the device.
     
  7. cpuRunningHot

    cpuRunningHot

    Joined:
    May 5, 2018
    Posts:
    94
    Looking for non-trivial obvious discussion. Yes I know I can test games and yes I know I can benchmark, duh. The question is there a consensus, aka. general opinion based on ( professional ) experience. 10 years ago, the general consensus was that normal maps were generally too expensive for mobile games, but hardware has changed since then, so I'm just wondering if that consensus has changed.

    aka. it's a question about general trends, not any specific game. Let's limit the conversation to that please :D
     
  8. cpuRunningHot

    cpuRunningHot

    Joined:
    May 5, 2018
    Posts:
    94
    Indeed, this is a good option. Some art styles may use normal maps as an optional embellishment and some may heavily lean on them ( and would look horrible without them ). So just feeling it out the topic for the case where normal maps are required for the project.
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,064
    Sampling a normal map by itself isn't expensive, the issue is that it implies realtime lights and more complex shading models which could be a problem.
     
  10. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,337
    Game's "hardcoredness" does not depend on graphics. It is based on gameplay and its perceived difficulty.

    You're highly likely to be fine, but that depends more on texture resolution and lighting quality.
     
  11. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,799
    It's not a useful "general trend" because it depends on things like the amount of textures used, texture resolution, and a whole host of other factors that make asking about just normal maps pointless.
     
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I was using normal maps on mobile in 2010 in Unity at 60fps, depending on device. I'm not sure how out of date you are but it's fine.

    It's always been fine. I think what's not fine, is what else everyone does. Fairly sure normal maps aren't the problem and haven't ever been the problem (except for misunderstood circumstances) as it's a low bandwith texture sample and simple math.

    By amateurs, yes. Anyone knowing what they were doing were not phased by normal maps. The issue wasn't normal maps back then on mobiles, since it was cheap then and is cheap now. The whole invention of normal maps is an optimisation. How you use them, such as having a lot of forward lights in an old Unity engine, that would be the problem.

    The math in the shader back then, for decoding and using a normal map, or the lighting calculations, that stuff is what actually made these slow. It's a distinction because a texture read back then for a normal was not more expensive than a texture read for any other number of textures. ALU sucked however.

    If you are using geometry, and want it to look higher poly, or revealing extra detail, that's the right use for a normal map. Nothing else (outside of custom uses as part of a greater effect like distortion).

    They require at least one realtime light to be of use in regular model rendering scenarios. Anyway I'm rambling as I shipped plenty of mobile stuff back then.

    TLDR: it's fine now but what's not fine... is the shader you're using and your grasp of target device bandwidth. If you are targeting OpenGL 2.0 devices then you probably won't make money unless it's 2D. Unity's moved on a lot so you'd be rolling your own shaders and using Standard Pipeline if you wanted good perf on ES 2.0 devices.
     
  13. cpuRunningHot

    cpuRunningHot

    Joined:
    May 5, 2018
    Posts:
    94
    Excellent. Thanks for your feedback, it was very helpful. My experience with normals maps and the math behind them is reasonably solid, but my experience using them on mobile is very limited. So I do not want to rely on assumptions.

    Also, regarding the previous comments about testing and benchmark on my own projects... indeed this has to be done as well and I checked with my team re: the minimum standard for Android devices and the answer came back as Samsung Galaxy S8. Since they are cheap, I went ahead and ordered it to test against a minimum standard. With Android, it's a fuzzier guideline since there are so many models out there, and for iOS, we are targeting iPhone 7+, so that's easier to determine.
     
    hippocoder likes this.
  14. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    Obsolete but also, converting full UV (tangent space) normal map into world normal map was a way to save a few alu back then, for static object in the scene. But holy, i bought some new phone and they are still weaker than a samsung galaxy s8 (~150 gflops vs ~600 gflops), still better than my sunsetted (by google and arms) archos (es 2.0 12gflops).
     
  15. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,492
    Like with desktop GPUs, the pure Gflops numbers are only really useful when comparing within the same or very similar architecture. Comparing on mobiles that's especially bad because some phones suffer of throttling more than others and the gflop values are peak values.

    What new phone did you get?
    The also already "old" S10 for example was significantly ahead of the S8 - at least by that fp32 number:
    https://gadgetversus.com/smartphone/samsung-galaxy-s8-exynos-vs-samsung-galaxy-s10-exynos/
     
  16. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    I know, still useful for order of magnitude comparison. My mali 400 advertise 300 000 poly per frame at 60fps (non unified shader core), I'm definitely planning for 50 000 just in case. Architecture can be at best 4x more efficients (own estimation, kinda baseless) assuming no new features (like programmable shader vs fixed function), new phone have compute and es3 which open opportunities I wouldn't have on the archos, tile base offer alternative memory bottlenecks, etc ...

    But still, a 150 gflops on old architecture is unlikely to beat a 600 gflops on new architecture, so there is still some values to know about it, as in a rough relative estimation (ie before fillrates, features, thermal and other throughput like memory access). You can ruled out a lot.

    And the phone is a samsung A10 ... it's more 64gflops (mali g71) than 110, I don't know where I got that last number, but doesn't change a lot... I can basically only afford phone under 100€ (so far).