Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using compressed and non compressed mipmaps


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Sagaceil   Members   -  Reputation: 162

Like
0Likes
Like

Posted 21 November 2013 - 03:56 AM

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 ! :)



Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 8606

Like
1Likes
Like

Posted 21 November 2013 - 05:23 AM

The specification requires all mipmaps to have the same internal format.



#3 Sagaceil   Members   -  Reputation: 162

Like
0Likes
Like

Posted 21 November 2013 - 05:28 AM

So actually theres no way to use compressed textures and use lower size than 4px. I supposue that compression require 4x4 px blocks to be compressed.



#4 Brother Bob   Moderators   -  Reputation: 8606

Like
0Likes
Like

Posted 21 November 2013 - 05:47 AM

There's no problem using compression for non-multiples of 4x4 blocks. Many, if not all, compression formats works just fine with any texture size.



#5 haegarr   Crossbones+   -  Reputation: 4588

Like
0Likes
Like

Posted 21 November 2013 - 06:42 AM


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 ...



#6 Brother Bob   Moderators   -  Reputation: 8606

Like
0Likes
Like

Posted 21 November 2013 - 07:19 AM

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, 21 November 2013 - 07:19 AM.


#7 Sagaceil   Members   -  Reputation: 162

Like
0Likes
Like

Posted 21 November 2013 - 07:37 AM

Ok, solved.

 

I'm uploading compressed mipmaps using glCompressedTex* ( mipmaps with size >= 4px ) and using glTexImage* with GL_COMPRESSED_RGB(A) for lower mipmaps.



#8 Brother Bob   Moderators   -  Reputation: 8606

Like
0Likes
Like

Posted 21 November 2013 - 07:45 AM

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.



#9 Sagaceil   Members   -  Reputation: 162

Like
0Likes
Like

Posted 21 November 2013 - 10:54 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS