Search Unity

Providing textures on the backend

Discussion in '2D' started by Deleted User, Oct 20, 2021.

  1. Deleted User

    Deleted User

    Guest

    Hi there,

    I have a problem with choosing what the best solution is for the following problem:
    Our app is heavily content based. We download textures from the backend on demand. We present those as sprites on our UI at about 600x570 pixels, which of course is not POT.
    Since they are downloaded one by one, my question is:

    - Create them as 512x512 and live with a small amount of blurriness? (is it justified)?
    OR
    - Create them as is, let the graphics card slap them on a 1024x1024 texture space each?

    If there's any other solution I am glad to hear it. Preprocessing is not an option. The order in which the images are used is so random, we cannot predict which ones to bundle up beforehand. And we want to keep each download time at a minimum so bundling up would cause unnecessary download time.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,674
    I find these sorts of decisions best to just pick one way but wrap up the API of the project so that the amount of code that has to change if you want to change it is tiny.

    Since UI takes a Sprite, your API should be just an async "fill out this sprite please" call, nothing else.

    Write that API one of your ways above, get it working, live and learn. You might even have pain points completely unrelated to anything you have speculated so far, which would make any choice now irrelevant.

    Iterate. It is SOFT-ware after all, which means it is SOFT and can be changed.
     
  3. Deleted User

    Deleted User

    Guest

    Hi,
    thanks for the answer. It's true it's software, but it will still take a tremendous amount of work to change all used sprites again. That's why I even raised the question if going 512 squared or something else. It's less about the code needed but more about the texture size used.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,674
    Indeed... and that is in turn much more dependent on the detail you want in the artwork and if it will look bad once the filtering takes it from 512 to 1024, or vice versa.

    If the icons are nice gradients and smooth color changes, it probably won't make any difference.

    If the icons are insects with legs crawling on a chain link fence it's probably a different story.

    Thus again, the question is impossible to answer in a vacuum. It actually hinges entirely on the context.