Hi,

> Have you tried setting GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL before 
> the first glTexImage2D call? Maybe this gives a hint to the driver, that the 
> texture will have more than just one level. 

Yes I tried  GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL, but It doesn't 
help.


> Another problem you should consider is that glTexStorage2D is only in the 
> core since version 4.2. So it will not work on older hardware.

I understand it. I suggest to use it via extension. if It  is not supported - 
then not use it.


> Another question: Do you now how osgEarth creates the new textures? Does is 
> create a new texture for every loaded image? If yes, it could be a good idea 
> to create set of textures at startup and re-use them(only change the content 
> with glTexSubImage2D). This could also help to improve the performance. 


Really it is not linked to osgEarth implementation. This video drivers 
behaviour is actual for any osg mipmaped texture.

But we can particulary hide this behaviour throught TextureObjectManager. 
TextureObjectManager have texture pool. Recently used textureobjects can be 
reused. Size of texture pool is configured via enviroment variable 
OSG_TEXTURE_POOL_SIZE.
but if pool have not free texture object then we have frame breaks.


Actually I found another solution for this issue.
if I call glTexParameter for hardware mipmap generation even image already have 
mipmaps and upload all mipmap levels, then driver upload all mipmap levels 
without any wait and without mipmap corruption.


Code:

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
upload all levels
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);




I'll post my workaround implementation to submission

Thank you!

Cheers,
Alexander[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59658#59658





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to