Search Unity

4 Solid colors in a texture file, what size (pixels)?

Discussion in 'Formats & External Tools' started by Axspeo, Sep 28, 2019.

  1. Axspeo

    Axspeo

    Joined:
    May 24, 2019
    Posts:
    15
    Hey guys, I made a model and it has a total of 4 materials, I know that is best practice to put them all in one texture file and uv map accordingly. The thing is, this model is for a low poly mobile game and the 4 materials are solid colors, therefore there isn't more detail in a 1x1 texture than a 256x256 texture, what size should each color occupie in the texture file and why? can i use 8x8 for each color? and why not 2x2 for example?
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    As far as I know, you mostly could do 1x1. I recommend more like 4x4 though just to be safe, or even 16x16. In theory it shouldn't matter, but depending on your shader and texture filtering settings, etc... you could get some bleed if you don't make things exact...and that couple extra pixels can mitigate that issue. If you have used textures as sprites before, you have to use the CLAMP wrapping on the edges for example, so the colors don't wrap to the other side of the texture since some filtering and AA options grab information from multiple pixels. You could look up the difference between a pixel and a texel, and figure out that filters affect what a texel color ends up being especially if it isnt' on the integer point of the pixels of the texture.
     
    Axspeo likes this.