Home Technical Talk

dds compression problem

polycounter lvl 14
Offline / Send Message
sama.van polycounter lvl 14
Hi all!

I never had lot of problems with dds compression.
But actually I don't understand why I have bad render with gradiant colors on DXT1 compression (RGB only).

- PNG file : 313ko
- DDS file : 170ko (with 9 mip map level)

Maybe can I have same PNG render with a 400ko/600ko file with DDS? and choose other parameters?

If you have solution or explication I'll be thankfull frown.gif

ddsproblem.jpg

original *.png file (512x512) :
Tow1_Wall_F.png

Replies

  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Hi Sama,

    Here's the deal:

    DXTN compression splits your image along 4-pixel boundaries, and each 4X4 tile gets its own palette.

    If you want your texture to look good, the lines on your image need to coincide with those 4-pixel boundaries.

    Your highlighted section looks crummy because the borders of those blue rectangles don't match the borders of the DXTN tiles.

    I'll whip up an an example in a minute...
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    OK, checkitout:

    I altered your texture so that the blue rectangles line up with the DXTN tile boundaries. They compress more cleanly now.

    closeup.png

    ... and here's the altered source image:

    manipulated.png


    I hope this helps!

    cheers,

    -Ryan
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Of course, if you aren't really low on video memory you might not want to use DXTN.

    If you save the DDS using RGB565, it will look much better and the size will be 512k. (682 with mips)
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    And you can still take the size down a little by ditching MIP levels - do you REALLY need 9 levels?
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    Ryan Clark :
    Ok, then Pior helped me to understand what your talking about laugh.gif
    Crazy explication then O_o, If I understand, I must create a grid with a grid by 4x4 pixel for work o_O... OMG it can be a crazy workflow then...
    Actually my diffuse workflow is this one but I must Add one step for prevent DXT compression...

    Or maybe I can develop tools in Maya (mel script) to change all UV position with pixel value on U or V position.
    For exemple, if 2 pixel decal on +U axis resolve problem I give this next information :
    - 2 pixels value on +U,
    - Specify texture node,
    > sleect all objects in my current scene with this texture node, and update Uvs position.

    Then thanks a lot for your help! I'll try your 2 choices!

    Rick_Stirling :
    Oh ? too many? how many levels do you use for one 512x512px please?
    It can help me to reduce texture size too ^_^
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Here is an idea:

    1. Draw your texture at 25% of its desired resolution.

    2. Scale up 400% using nearest neighbor

    3. Paint over your texture at full size to add detail

    If you follow that workflow, your texture features will correspond to DXTN tiles automatically.
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Just use DXTRGB888 compression. The filesize is larger, but it's still far more efficient on loading than the raw tga or png would be. And it's damn near lossless.
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    hi! Finally I used DXT3!

    You can see little technical demo on this link :
    News_07_10_01_A00.jpg
    Text are french, but you can easy find the "Demo Technique 1.1" link.

    If you try it, please leave any comments on "blog" with your fabulous English! ^_^

    This is an amator team, and like work with them!
  • Eric Chadwick
    Options
    Offline / Send Message
    If no alpha, why use DXT3?

    DXT1 w/ no alpha should be same result as DXT3 or DXT5, right?
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    Yes, I though that too, but I obtain best result with dxt3 than dxt1....
    Donc't ask me why, I don't understand it too. crazy.gif
  • Eric Chadwick
    Options
    Offline / Send Message
    What compressor? If there's no alpha in the source, the compressor should do the same RGB compression for all of the DXT formats. IIRC, when there's alpha the compressor has to reduce the bits for DXT1's RGB.

    Probably not a big deal for your demo, but DXT3 is nearly twice the size of DXT1.
Sign In or Register to comment.