[osg-users] INVALID_OPERATION with compressed textures with mipmaps in OSG 3.4.0

Robert Osfield robert.osfield at gmail.com
Thu Sep 24 12:26:13 PDT 2015


Hi Scott,

Thanks for the follow up.

Could you post the whole modified file, this way we can avoid any possible
copy and past errors.

Thanks,
Robert.

On 24 September 2015 at 20:13, Davis, Timothy S CTR comnavairsyscom <
timothy.s.davis.ctr at navy.mil> wrote:

> Sorry.  It keeps trying to encrypt the message.
>
> Robert
>
> While continuing to build a model that results in the problem, I
> discovered something I didn't see before.  The IVE model had an incorrect
> number of mipmap levels (it had 8) for a 32x32 texture.  It makes sense
> that glTexStorage2D would generate INVALID_OPERATION in this case.
> Rebuilding the model from a source with uncompressed textures and
> recompressing the textures worked.  The original model was converted with a
> much older version of OSG, pre OSG 3 for sure.
>
> So I was barking up the wrong tree:)
>
> That addresses my specific issue without needing a change to OSG 3.4.0.
> However, I still think it is worth trying for the OSX case.
>
>
> Trajce
>
> In osg/Texture.cpp, function applyTexImage2D(), find the line:
>
> useTexStorage &= sizedInternalFormat != 0;
>
> add the following after the line:
>
> if ( useTexStorage && compressed_image && numMipmapLevels > 2 )
> {
>     numMipmapLevels -= 2;
> }
>
> This is clearly not production quality as it assumes block size is 4 and
> complete mipmaps to 1x1.  It should be enough to check the approach.  You
> may have to set GL_TEXTURE_MAX_LEVEL if the driver thinks the texture is
> incomplete, but I didn't have that issue.
>
> Scott
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150924/4f299ada/attachment-0003.htm>


More information about the osg-users mailing list