Thread restart

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
slime
Solid Snayke
Posts: 3176
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Thread restart

Post by slime »

This is getting pretty off-topic, but the gains are much more than just memory (and even those are huge - DXT1 takes up 1/8th the RAM and 1/8th the VRAM for images without alpha in LÖVE, and DXT5 takes up 1/4th the RAM and 1/4th the VRAM.)

As I said before, they also load many times faster than regular images. A PNG which takes 4ms to load takes just 0.14ms as a DXT5 image for me.

Compressed textures (DXT being the most common compression method by far) are very useful for performance because they allow much more of the texture to fit inside the GPU's texture cache, which can result in very impressive performance gains in some situations. Here is a very basic test I did a little while ago: download/file.php?mode=view&id=23048 vs download/file.php?mode=view&id=23049
raidho36 wrote:I think the best way to employ them is to 1) expose DXT-compressed textures handling functions to user, in addition to regular textures, and 2) have tools for dynamic DXT compression of regular textures, once again by user demand. I wouldn't like if löve2d screwed up my sprites because it thinks it's more effective that way.
The way it's currently implemented for the yet-to-be-released 0.9.0, love.graphics.newImage will automatically detect whether the file is DXT/RGTC and either load it as straight compressed texture data, or as a regular ImageData. You can also manually try to load a file as either, via love.image.newCompressedData and love.image.newImageData.
There is no runtime conversion.

EDIT: I forgot to mention, one of the benefits of DDS files in particular is they can store mipmaps right in the file. LÖVE 0.9.0 will detect this and use the mipmaps from there if mipmapping is enabled for that image (another new 0.9.0 feature).
Attachments
KpxeL5o.png
KpxeL5o.png (524.66 KiB) Viewed 174 times
IDbbIIS.png
IDbbIIS.png (513.5 KiB) Viewed 174 times
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Thread restart

Post by raidho36 »

I don't mind derailing since I get the answer I was hoping not to get but was thinking as only fair solution.

Yes I know that it does saves memory, a lot of it. I didn't exactly knew it was anywhat faster than plain bitmap data, but by "small if any" performance boost I mean that slightly improved texture sampling speed doesn't contrbute much to complex shader computations.

Maybe for that image it was just poorly designed compressor. But still, AFAIK (correct me if I'm wrong) the DXT is limited to 4 interpolated colors (out of just two marginal colors) at 4x4 square, which isn't quite good, definitely not good for my pixel sprites.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest