Results 1 to 3 of 3

Thread: compressed mipmapped cubemaps

  1. #1
    Member Newbie
    Join Date
    Jul 2002
    Location
    Guildford, UK
    Posts
    36

    compressed mipmapped cubemaps

    Hi,

    I've just tried implementing cubemap support by reading from a DDS file (they are DXT1 compressed).

    According to the DDS specifications for cubemaps, the faces each appear with their mipmaps following sequentially after them.

    So the sequence to load is POSITIVE_X, miplevel 0, 1, 2, 3, etc. Then NEGATIVE_X, miplevel 0, 1, 2, 3, etc.

    I call CompressedTexImage2DARB with the appropriate face as the target (1st arg) and the miplevel set as the 2nd arg, and GL_COMPRESSED_RGBA_S3TC_DXT1_EXT as the 3rd arg, and so forth.

    I then set up the minification filter to be GL_LINEAR_MIPMAP_LINEAR and a mag filter of GL_LINEAR.

    Doing this, my model renders white (I've had this before if miplevels aren't loaded with a mipped filter).

    If I change the filters to GL_NEAREST_MIPMAP_NEAREST and GL_NEAREST, then I see some of what looks like the top level mip, but interpolated with white.

    If I load a different DDS file with a non-mipmapped but compressed cubemap, and set the filter to GL_LINEAR, GL_LINEAR then I see the cubemap fine.

    I've seen the same thing on a GeForce4 Ti4600 and a Radeon 9700, both with latest drivers.

    Has anyone else seen anything like this before, as it's driving me nuts?


    Cheers,


    Mark

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2003
    Posts
    177

    Re: compressed mipmapped cubemaps

    Check what glGetError() returns after each of your calls to load the texture. Perhaps something is missing. Also, make sure you have all the mipmap levels: that is, your final cubemap is 1x1x1.

  3. #3
    Member Newbie
    Join Date
    Jul 2002
    Location
    Guildford, UK
    Posts
    36

    Re: compressed mipmapped cubemaps

    Do'h. You got it.

    I wasn't reading the last 1x1 mipmap, so I guess it was reading incorrectly offset data from the dds file from the NEGATIVE_X offset onwards.

    Cheers!

Similar Threads

  1. switching between FBOs with mipmapped textures
    By despoke in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 05-01-2008, 08:47 AM
  2. Should non-mipmapped textures be a huge slowdown?
    By Leadwerks in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 12-10-2007, 01:33 PM
  3. FBO & mipmapped fp16 cube maps
    By fahlen in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 09-01-2005, 11:09 AM
  4. Got a 128 bit texture mipmapped. How can I load it back into an array?
    By Blade the Voyager in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 02-12-2004, 01:08 PM
  5. Mipmapped glCopyTexImage2D() s-l-o-w. why?
    By StefanG in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 11-03-2002, 08:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean