Opened 7 years ago

Closed 6 years ago

#460 closed defect (fixed)

Buildicons should be 256X256 sharpened DDS

Reported by: beherith Owned by:
Priority: major Milestone:
Component: BAR Version:
Keywords: Cc:

Description (last modified by beherith)

Why? .png is the worst possible format for images in spring mods:

  • png compression is no better than 7z or zip
  • png needs to be loaded into ram, decompressed to its full size, have the mipmaps generated on the fly (with the slow and suboptimal Box filter engine default), then pushed to gpu.
  • DDS is better because: no decompression needed, it is decompressed with mod and sent straight to gpu, allows custom mip filters, and is stored compressed in gpu ram.
  • .png transparency is NOT portable and photoshop and other editors have serious issues with it.
  • A 128x128 png will take 87KB in gpu ram, while a 256x256 DDS will take the same size, and load faster and have higher resolution and look better rescaled.
  • DDS supports single channel textures, such as the ones best suited for teamcolor overlays
  • dxt3 is recommended for smooth alpha transitions, dxt5 for hard alpha.
  • DDS does have 2 disadvantages: lossy compression (can be disabled with the -u8888 instead of -dxt3), difficulty editing (most major image editors support it with plugins).

The recommended command to compress to DDS for unit is: nvdxt.exe -file myfile.tga -Sinc -quality_highest -dxt3

Change History (10)

comment:1 by beherith, 7 years ago

Description: modified (diff)

comment:2 by beherith, 7 years ago

Description: modified (diff)

comment:3 by beherith, 7 years ago

Description: modified (diff)

comment:4 by Funkencool, 7 years ago

No arguments here.

Last edited 7 years ago by Funkencool (previous) (diff)

comment:5 by Funkencool, 7 years ago

I think this will go a long way towards improving performance of my sMenu. Not only being DDS, but I also assume unit icons given by unitdef are cached? AFAIK there's no such thing happening for my pngs currently.

Out of curiosity I'll see what kind of performance I get using old icons with broad selections compared to new. Unfortunately my game crashes on /give all so it won't be as thorough. (infolog says graphics driver related)

comment:6 by beherith, 7 years ago

dunno about the gfx card crash, but an infolog may be useful. I only just discovered that there is some caching lua script that preloads these resources. i need to adapt that to preload unit atlasses since they will be usee ingame anyway, yet they are so large they cause a perceptible pause when loaded.

comment:7 by beherith, 7 years ago

also, i dont know about using dds with textures that are auto atlassed by the engine (pretty much just the projectile and ceg stuff) because mips wont help there.

comment:8 by beherith, 7 years ago

Ok, there is one thing against them being 256x256 and getting all cached: that is 370*2*81K gpru ram, like 60 mbytes. Thats a lot, maybe they shouldnt all get cached?

comment:9 by Bluestone, 7 years ago

97+git gives 800mb lua RAM and we are currently using <100, so thats fine

maybe having them as chili objects uses more, but imo sharper buildpics would be a big improvement on current ones

Last edited 7 years ago by Bluestone (previous) (diff)

comment:10 by Bluestone, 6 years ago

Resolution: fixed
Status: newclosed

they are now

Note: See TracTickets for help on using tickets.