Home Technical Talk

Mip Maps and Non Square Textures for DDS.

polycounter lvl 18
Offline / Send Message
oXYnary polycounter lvl 18
You know, I'm not seeing anything on this from my weak Google search skills.  I have been told that to use non square textures because dds files will create blank areas for the non square area so you end up with file sizes just as large as the largest dimension.

If this is common and such a waste, why is this not mentioned more?  Especially for larger size textures.  (like 2kX4k becoming 4k in the mipmap area).

Replies

  • Eric Chadwick
    Hey there oXY.

    2nd Mip for a 2048x4096 would be 1024x2048, then 512x1024, etc.

    However, depending on the converter, if you feed it a non powers-of-two image, then it may pad the size upwards.

    If the converter was dumb, 2049 would be padded out to next larger pow2... which would be 4096.

    If converter doesn't change mesh UVs then you get slippage, could be really bad.

    Dxt does always require pow2, thus it needs to do something.

    If converter was smart, it would downsize or upsize, instead of pad. But if you're just a few pixels off-size then you'll get resampling errors on the rescale.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Can you recommend a converter that will auto resize the Mipmaps correctly without padding?  I believe this all came up originally because of the PS Nvidia plugin, so it cant be that one.  Substance doesn't even offer dds mipmaps, so I cant use that.
  • Eric Chadwick
    What is your texture size? What engine are you using?
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Dealing with Textures Like 2kX4K and vice versa for horizontal/vertical.  Engine is the MIT Torque, which the programmer who is working on the core dev wants to know quote
    https://github.com/GarageGames/Torque3D/commit/f6d624be8f22c1d67bf6fd498fd4ee32d9b7e487#diff-28458f5ff67e0175e05f1e3ac7adc6c2
    "feel free to throw the guy asking what engine that. red is what I tried before to get it sane, greens what we had to settle for."

    (He thinks every artist is a tech artist.. Ok he wants to believe).


    I think he means the red and green commented area.



  • Eric Chadwick
    I'm no programmer. The code is gobbledegook to me. 

    If you're forced to use square textures, then you can pack two rectangle textures into one square texture sheet. Then use a UVW Xform modifier to quickly scale and offset the objects' UVs to match the new UV layout (or use UVW Unwrap for a more visual method). Assuming you're using 3ds Max; similar methods exist in other software.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Lee D. ended up discussing it with the programmer.  It sounds like indeed all dds files are square mipmaps with no way around that.  Most companies just ignore the wasted space.  Your above is a great suggestion/workaround, thanks!
  • Eric Chadwick
    Must be a limitation of that particular engine. It's not a limit of the DDS format.

    IIRC, DXT compression format is limited to a minimum height of 4 pixels. And textures must be powers-of-two. But don't have to be square. You could have a 1024x4 texture for example.
Sign In or Register to comment.