From Colin McDonald, "Upgrading to OpenSceneGraph 3.0.1, texture mip mapping stopped

working on some junk low-end graphics cards which I still have to
support.  They worked ok with osg 2.8 and earlier.

The problem turned out to be with gl proxy textures, which are
unreliable on those devices.  Proxy textures are used by the glu
mipmap build routines to determine if a texture size is
supported. The external glu library had a nice fallback
behaviour, so that if proxy textures didn't work then the mipmap
texture was still created.  But in the work on the new embedded
glu routines that fallback behaviour has been inadvertently
lost.  I have restored the fallback in
src/osg/glu/libutil/mipmap.cpp.  It doesn't add any extra
complexity."
This commit is contained in:
Robert Osfield
2012-02-10 17:20:43 +00:00
parent d507a54456
commit 4457d2a145

View File

@@ -3492,35 +3492,36 @@ static void closestFit(GLenum target, GLint width, GLint height,
* that we will never be aware of when this happens
* since it will silently branch out.
*/
*newWidth= 0;
*newHeight= 0;
return;
break;
}
widthPowerOf2= widthAtLevelOne;
heightPowerOf2= heightAtLevelOne;
}
/* else it does fit */
} while (proxyWidth == 0);
/* loop must terminate! */
/* return the width & height at level 0 that fits */
*newWidth= widthPowerOf2;
*newHeight= heightPowerOf2;
if ( proxyWidth > 0 )
{
*newWidth= widthPowerOf2;
*newHeight= heightPowerOf2;
/*printf("Proxy Textures\n");*/
return;
}
} /* if gluCheckExtension() */
else
#endif // end of #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
{ /* no texture extension, so do this instead */
GLint maxsize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
/* clamp user's texture sizes to maximum sizes, if necessary */
*newWidth = nearestPower(width);
if (*newWidth > maxsize) *newWidth = maxsize;
*newHeight = nearestPower(height);
if (*newHeight > maxsize) *newHeight = maxsize;
/* no texture extension, or proxy textures not working, so do this instead */
GLint maxsize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
/* clamp user's texture sizes to maximum sizes, if necessary */
*newWidth = nearestPower(width);
if (*newWidth > maxsize) *newWidth = maxsize;
*newHeight = nearestPower(height);
if (*newHeight > maxsize) *newHeight = maxsize;
/*printf("NO proxy textures\n");*/
}
} /* closestFit() */
GLint GLAPIENTRY