Sign in to follow this  
Sagaceil

Using compressed and non compressed mipmaps

Recommended Posts

Sagaceil    372

Is it posible to use both compressed and uncompressed texture data when uploading mipmaps for texture ? I'm working on better streaming system for textures with seamless transition beetwen mipmap lvl's. 

So far so good. Everything working fine untill I'm uploading non compressed data using glTexImage. I'm setting GL_TEXTURE_MAX_LEVEL to the last (1x1) mipmap index but it seems that texture gets uncompletness when that happen. I'm forced to set GL_TEXTURE_MAX_LEVEL as the last compressed mipmap and then it works.

My question : bcoz glTexImage doesnt return any GL Error, is it possible to use non compressed data with compressed in another mipmaps ( compressed data works great when te resolution is >= 16, i need <16 texture mipmaps to avoid aliasing ).

 

Thanks for any help ! :)

Share this post


Link to post
Share on other sites
haegarr    7372


Many, if not all, compression formats works just fine with any texture size.

That would be nice, but is it so? I've found contradictory statements about the ability to compress NPOT textures.

 

My last own tests regarding this issue were done with OpenGL 2.1 on Mac OS 10.6, and at that time using GL_RGB as external format and GL_COMPRESSED_RGB as internal format to glTexImage2D has led to internal format GL_RGB8 for a rectangular texture, regardless whether its size was a multiple of 4 in both dimensions or not. The same image but padded to square POT size then led to GL_COMPRESSED_RGB_S3TC_DXT1 internal format.

 

The ARB_texture_rectangle stated that glTexImage is allowed to do what is shown by mentioned tests. It further stated that glCompressedTexImage is not supported for rectangular textures, although there is room for enhanced formats: "This is because several existing hardware implementations of texture compression formats such as S3TC are not designed for compressing rectangular textures. This does not preclude future texture compression extensions from supporting compressed internal formats that do work with rectangular extensions ..."

 

And the specification for OpenGL 4.4 core profile states in section 8.7: "... except that compressed rectangle texture formats are not supported."

 

On the other hand I've read somewhere that it is actually found that some implementations actually do accept pre-compressed rectangular textures, although even it may be that they do not compress such textures themselves.

 

Very confusing ...

Share this post


Link to post
Share on other sites
Brother Bob    10344

I have no problems with odd-sized texture compression, they load just fine. I get compressed internal formats for odd-sized textures with uncompressed and compressed source data and with a generic and a specific compressed internal format.

 

You keep talking about texture rectangles though, they have some general limitations as far as I remember. I have never used them so don't know how they interact with texture compression and if there are some additional requirements.

Edited by Brother Bob

Share this post


Link to post
Share on other sites
Brother Bob    10344

Just curious, why aren't you using the same for methods for mipmaps less than 4 pixels? I don't know the internal format is supposed to be chosen for a generic format, but chances are that the explicit format you use for images larger than 4 pixels just happens to be the same as the generic format for images smaller than 4 pixels. If the driver cannot use the same format for the generic one, your approach till fail.

Share this post


Link to post
Share on other sites
Sagaceil    372

When Im importing textures to engine, Im doing offline compression using close fit range compression. So I have to ananlize whole 4x4 blocks as an input. When loading textures , they are in compressed format arleady, and the last mipmaps are stored as a raw RGB(A) data.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this