DDS in Python

Due to some work duties I’ve been all day messing around with DDS files and python. DDS is a file format that is capable to store compressed textures, the interesting thing is that the compression algorithms on DDS files are supported by the current graphics card, it means you don’t have to uncompress them before sending them to the VRAM, opposed to what you would do when you  use JPGs (you have to load the file, uncompress it, ans send it to VRAM).

There are more pros, the mipmaps for instance, with the regular textures the driver is in charge to create the mipmaps when uploading a texture, and that is slow as hell, indeed most of the time we spend uploading a texture is the mipmaps’s construction process.

And there is still an advantage, the textures are stored compressed in VRAM (less memory), and can be accesed without uncompressing the whole texture, so it means the internal buses of the card are more free, and it traduces to better performance.

Ok, so what about DDS in python? well, sad news is I couldnt find anybody who made a DDS file loader, PIL doesnt support them. So maybe I will get interested on adding DDS file support to my little framework.

It is not hard, I just need to read the header but to support DDS means lots of work.

But once again, too much wrapping, not enough creation. So this feature will get on hold till I really need it.

Today I found this interesting work by Dasol, it is a procedural spiral generator and he uses also some celullar automata for the background. I felt like he beated me somehow because that was more or less the kind of stuff I tryed to achieve when coding my celullar automata but I didn’t spend much time in polishing it or giving it some kind of meaning. Also the automata is cool, and the way he renders the board (using a texture for every cell looks cool when you zoom in) is clean.

Anyway, ideas for the pyncel app:

  • create a SceneGraph
  • refactor the canvas to make every canvas more like a SceneEntity of a SceneGraph
  • some tools to move and rotate objects
  • create a background texture loader
  • create a internet image loader

Sounds boring but the results could be nice. So no screenshots or code for today.

3 Responses to “DDS in Python”

  1. r2d2rigo Says:

    Nice work there, Javi. These new batch of posts about computer graphics are surely very interesting and informative 🙂

  2. julian bonequi Says:

    Mi querido Javi… tienes videos de todo esto… quiero enseñárselo a alguna gente… que siempre te hago promoción

    Un abrazo!

  3. hogjonny Says:

    DDS viewer: https://github.com/agileperception/pyglet/blob/master/tools/ddsview.py

Leave a Reply


5 + = twelve