[osg-users] Texture Caching Problem with 3.6.3/4
OpenSceneGraph Users
osg-users at lists.openscenegraph.org
Tue Mar 31 07:04:29 PDT 2020
Do you have hangouts
On Mar 31, 2020 14:42, "OpenSceneGraph Users" <
osg-users at lists.openscenegraph.org> wrote:
> Hi Robert,
> I stumbled upon this topic while I was looking for a similar problem that
> I am having using osgEarth in an osgQt viewer. I am posting this message
> here because I think that the two problems might be related and I hope that
> you could help me. I am using OpenSceneGraph-3.6.5 and osgearth-2.10.1.
>
> I noticed it while I was coding my application but recently I saw that the
> same error messages are displayed by osgviewerQt as well.
> I am using a demo.earth file that uses local geotiff files stacked in a
> composite image and, above that, I placed the following cache configuration:
>
> <options>
> <cache driver="filesystem">
> <path>/home/emanuele/mapsCache</path>
> </cache>
> </options>
>
> If I run "osgviewer demo.earth", the globe is shown without any error
> messages but if I run "osgviewerQt demo.earth", it happens something
> similar to what Greg described in his post: if I run osgviewerQt with an
> empty cache folder, no messages are printed but when I run osgviewerQt
> again, a few error messages are printed... and I am not sure if the program
> is loading images from the cache folder or from the specified files. The
> messages disappear if I remove the cache section from the earth file.
> They are the following:
>
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> [osgEarth]* [TerrainLayer] Layer "image" Metadata appears to be corrupt.
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> [osgEarth]* [TerrainLayer] Layer "Elevation2" Metadata appears to be
> corrupt.
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> [osgEarth]* [TerrainLayer] Layer "Elevation1" Metadata appears to be
> corrupt.
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> [osgEarth]* [TerrainLayer] Layer "world-tiff" Metadata appears to be
> corrupt.
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> [osgEarth]* [TerrainLayer] Layer "SermonetaWide" Metadata appears to be
> corrupt.
> [osgEarth]* JSON decoding error: * Line 1, Column 67
> Missing '}' or object member name
>
> The first error messages are printed as soon as I run the program, the
> following appear when I zoom on the map.
> I have already talked with Glenn Waldron (osgEarth) about this messages
> and he thinks that, since osgviewer is working fine, they might be related
> to some threading issues in osgQt.
>
> I'd really appreciate your help. Thank you,
> Emanuele
>
> Il giorno lunedì 16 dicembre 2019 18:08:34 UTC+1, Robert Osfield ha
> scritto:
>>
>> Hi Greg,
>>
>> Today I worked on improving the ObectCache::releaseGLObjects()
>> implementation so that it removes objects in the scene that are Texture or
>> contain Textures in their subgraph, where the Texture no longer have any
>> associated osg::Image. I believe this resolves the usage case :
>>
>> 1. Load the scene graph, with the Texture UnRefImageAfterApply
>> setiings are set to UnrefImageAfterApply, with the loaded textures/scene
>> graphs being cached in the osgDB::ObjectCache.
>> 2. Render the scene graph, resulting the in the scene graph images
>> being unref'd from their Textures.
>> 3. Close the Window, which cleans up the scene graph GL obects by
>> calling releaseGLObjects()
>> 4. Load a new scene graph with textures/objects loaded from disk and
>> where possible from the ObjectCache if previously loaded and cache, Got
>> back to 2. (Rendering etc.)
>>
>> I created an example that follows all these steps and it reproduced the
>> problem with the textures appearing black on the second time around when
>> loading an OpenFlight database. With the fixes to
>> ObjectCache::releaseGLObjects() the unref'd images are automatically
>> removed from the cache as part of step 3. above, so that they aren't shared
>> any more, instead new copies are loaded from disk with their image in place.
>>
>> This fix is checked into the OpenSceneGraph-3.6 branch. The commit is:
>>
>> https://github.com/openscenegraph/OpenSceneGraph/commit/9ae4
>> 7b921b2184788e6efe85692908bd0ba900a2
>>
>> Could you please test this out. You should be able to remove your own
>> manually clearing of the ObjectCache now, as it will be done automatically
>> when required.
>>
>> Cheers,
>> Robert.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscribe at googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/osg-users/93b6ffd8-b2e6-43c0-a6c8-3ef11949bbaf%40googlegroups.com
> <https://groups.google.com/d/msgid/osg-users/93b6ffd8-b2e6-43c0-a6c8-3ef11949bbaf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> _______________________________________________
> 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/20200331/bb85761a/attachment.html>
More information about the osg-users
mailing list