Hi Robert,
On 07/06/10 17:42, Robert Osfield wrote:
Hi J.P,
This is an issue that's been covered before. The basic problem is
that as an optimization for memory footprint the imagery is discarded
after it is download to the the OpenGL texture, so once you discard
the OpenGL texture object all record of it is lose - hence the white
textures.
Oh OK. I didn't recognise this as the same issue, because we are getting
white/corrupted/flipped textures in the original view, not the added
view. (E.g. when pressing "a" twice with WORKAROUND_SHARE_CONTEXT
enabled in the test I sent.)
You can disable this feature by setting:
DatabasePager::setUnrefImageDataAfterApplyPolicy(true, false);
Yay, this does seem to cure it. However, when not in SingleThreaded
mode, I get increased VIRT memory use after each add/remove cycle. E.g.
after a lot of adds/removes I get to (top):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4604 jpd 20 0 2370m 48m 15m S 99 2.4 0:34.57 test
So at some stage no more virtual mem can be requested from the kernel
and the app hangs.
When first switching to SingleThreaded ("m") and then adding/removing
the mem stays constant. I'll use this for now.
Or enable the texture pool as this disables the
UnrefImageDataAfterApply globally as the features isn't compatible
with using of the texture pool. You can enable the texture pool via
osg::DisplaySettings::setTexturePoolSize(theSizeInBytesToUseForTheTexturePool);
or via the env var OSG_TEXTURE_POOL_SIZE.
This does seem to make a difference vs not setting the size (I did e.g.
export OSG_TEXTURE_POOL_SIZE=536870912), but after three "a" presses I
still get white textures.
Thanks for your help. Let me know if I can help with more info.
rgds
jp
Robert.
On Mon, Jun 7, 2010 at 4:19 PM, J.P. Delport<[email protected]> wrote:
Hi,
we are getting missing or corrupted textures in one of our apps when adding
and removing views. I've managed to create a test app from an earlier
example J-S made to show problems when adding and removing views. I'm
running svn head.
To reproduce:
compile
$ cmake .
$ make
and then run e.g.
$ ./test http://www.openscenegraph.org/data/earth_bayarea/earth.ive
or use any other vpb database.
Test1:
When the window opens, press "a". A new view showing the earth should open.
Now press "a" again. Now only the first view remains, but with missing
textures. If one zooms in, newly paged textures are shown.
Some errors printed include:
Warning: detected OpenGL error 'invalid enumerant' at after
RenderBin::draw(..)
Warning: detected OpenGL error 'invalid enumerant' at After
Renderer::compile
Test2:
comment out
#define WORKAROUND_SHARE_CONTEXT
in the osgviewer.cpp
Now on the first press of "a", the new window has a globe with no textures.
If one zooms in, newly paged textures are shown.
I'm not sure if this is a bug or if I have to do something special to the
DatabasePager to get this type of use case to work.
Setting threading models does not seem to change anything. Our app uses
SingleThreaded.
It's as if textures are deleted from the wrong context or as if too many
textures are deleted.
Any ideas/suggestions welcome.
cheers
jp
--
This message is subject to the CSIR's copyright terms and conditions, e-mail
legal notice, and implemented Open Document Format (ODF) standard. The full
disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean. MailScanner thanks Transtec
Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org