View Full Version : 16 bit bitmaps as texutres

09-03-2004, 03:34 AM
iz it possible and what parameters should I pass to gluBuild2dMipmaps? Thanks.

09-03-2004, 06:36 PM
gluBuild2dMipmaps doesnt accept the 16 bit pixel format tokens. read the spec on it:

you could use one of the compressed formats (some of which are 16 bit)

in conjunction with auto-mipmap generation

otherwise, just convert your image data to one of the accepted pixel formats (pretty darn easy, but a slight pain in the butt):

09-06-2004, 11:23 PM
10x for answering me. Could you give an example of using compressed textures. I searched the net for tutorials or demos but I couldn't find. If you have any links or sample sources I would beg you for posting them.

09-07-2004, 12:36 AM

09-07-2004, 03:58 AM
Thanks Nico I checked the link and it really works but is it linux portable? GCC gives DDSURFACEDESC2 undeclared. I know that the problem comes from the fact that I don't have direct X under linux. Any suggestions or .DDS format is windows specific?

09-07-2004, 06:10 AM
Read this documentation


They use a utility from the directx sdk to compress cube maps with mipmaps into a single dds file. You can most likely write your own function in linux for that.


09-07-2004, 12:54 PM
unfortunately, this isnt a trivial task, nor is it a joyous one.

heres another demo that loads a dds (skip down a bit in the list):

i havnt tried it, but it looks ok. the only caveat is the need to include ddraw.h for the DDSURFACEDESC2 definition. you can try to create this structure yourself from the docs (MSDN):

or, just download the monster sdk (~230 megs):
http://www.microsoft.com/downloads/detai...&displaylang=en (http://www.microsoft.com/downloads/details.aspx?familyid=fd044a42-9912-42a3-9a9e-d857199f888e&languageid=f49e8428-7071-4979-8a67-3cffcb0c2524&displaylang=en)

this took me 14 hours with my "tin cans connected by a string" connection.

09-07-2004, 01:15 PM
rats, heres the link to the structures (*sigh*):
http://www.microsoft.com/downloads/detai...&displaylang=en (http://www.microsoft.com/downloads/details.aspx?familyid=fd044a42-9912-42a3-9a9e-d857199f888e&languageid=f49e8428-7071-4979-8a67-3cffcb0c2524&displaylang=en)

09-07-2004, 01:19 PM
well, on the other hand, there's the link to the structures:
http://msdn.microsoft.com/library/en-us/....asp?frame=true (http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/ddstrcts_0189032a-8282-4ea7-b87d-90476b6f328d.xml.asp?frame=true)

(head is extra boney today)

09-09-2004, 03:16 AM
Unfortunately questioning continues... :( All went very well till the moment I found that DRI drivers for Ati Radeon Mobility 7500 from dri.sf.net does not support the S3TC extension, nor any other TC extension. In fact how many TC extensions are there? I know only for the S3 and FX extensions.

Why RLE compressed TGAs aren't supported for real time decoding? I might be wrong but from what I have read and what I have seen, makes me think that it is true. I have never read somebody saying it is not possible but all TGA loaders I've found in the net first decompress and then pass image data to the GL functions.As a final approach I am thinking about adding the S3TC extension to the ICD but for doing it right I need some open source video driver which supports it(I know that's not an easy task but go prove I'm not wrong to the project manager...). Thanks once again.