Luca's picture

OpenTK and DDS

Hi!
I found the following page while Googling for the OpenGL way to load DDS textures: http://www.opentk.com/node/253 . In this page it is mentioned a class called ImageDDS, whose purpose should be to load a .dds file into an OpenGL texture. Is this just an implementation proposal or there really is some code to achieve this? I can't seem to find it in the SVN repository.

I became interested in .dds textures because my project is quite slow in the initial load of a single, large texture (with Glu.Build2DMipmap). Although comments on the web are contrasting, some pages suggest that using DDS would load faster. Can anybody confirm/deny this claim? Now I'm using GDI+ to load a PNG texture and in the process it uses ~500 MB of RAM (8192x4096x24bpp). Would DDS improve this, in some magic kind of way?

I'm quite new to OpenGL programming, so please if what I say is plain wrong you're free to slap me in the face with a large trout :D


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Inertia's picture

There exists a working .dds loader for OpenTK which can load DXT1/3/5 compressed textures. The way it currently works, it will most likely be slower than Glu, because dds files use DirectX texture coordinates and the image must be flipped upside down for OpenGL's texture coordinates (this implies making a copy of the image, or not flipping the image and use DX texcoords in your app). The loader is not designed to be a final solution though, the idea is to use it to import the dds file into OpenGL and save the returned image into your own custom texture format via GL.GetCompressedTexImage(). This has the advantage that you don't have to flip the image every time it is loaded, requires minimum loading time/memory and helps securing your textures from manipulation.

keitsi's picture

Do you have a link to the DDS loader?

I can't find it either.

Inertia's picture

It's included in the parallax test:

http://www.opentk.com/node/394

useful 'known issues':

http://www.opentk.com/node/253#comment-1774