Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Mitchell resizing algorithm in 2017.2

Discussion in '2017.2 Beta' started by AcidArrow, Sep 1, 2017.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    I saw that we can now choose Mitchell for resizing textures. Which is cool, since it's generally a much higher quality algorithm than bilinear, but may I ask why was Mitchell chosen?

    I think Lanczos would be more appropriate, since sharpness of textures is extremely important in gamedev and Lanczos, while not *that* different looking than Mitchell, is a bit sharper.

    Are we going to see more algorithms added in the future?
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    Perhaps you also want to provide an API to allow customers to add their own resize algorithms. Or is this possible already, via a custom asset importer (don't think so)?
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's generally true for something like UE4 but not true for something that is already sharp by default. UE4 deliberately creates a lot of blur as part of it's post chain and makes some key decisions here to sharpen the textures more than normal to compensate, so I would prefer Unity have Mitchell with Lanczos optional, so...
    Yes please :)

    Although I probably will never want to do my own on account of being crap at it.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    Don't quite see how UE4 is relevant. I think wanting to keep some of the sharpness of textures when downscaling is something a lot of devs might want, regardless of engine.

    Also, in case I wasn't clear (and reading my original post back, it seems I wasn't), I'm not suggesting they remove Mitchell, I just want them to add Lanczos as well, since in my opinion, it's even more useful.

    And I mean, it's not like Lanczos and Mitchell look that different. Compare these:

    https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/mitchell2.png

    https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/lanczos2.png

    (taken from : https://clouard.users.greyc.fr/Pantheon/experiments/rescaling/index-en.html )

    I think they look kinda similar, with lanczos being ever so slightly sharper.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sure, for your case. I'm saying for a lot of people in Unity, it's not the case. You do add information by sharpening.

    So it has to be conservative, or optional, unless you're telling me that it works for everything great, then I'll just defer to your wisdom on that.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    And I'm saying the exact same thing to you.

    I guess unless we make a poll and force every user to take part, we'll never know the true answer.

    Lanczos isn't doing sharpening, at least in the traditional sense. It's a resampling algorithm. Its worst aspect is that it might introduce ringing (depending on the implementation, there are a ton of variations), which is also true for Mitchell, just less.
     
    hippocoder likes this.