Robert,

I just read your reply after I had sent my email response to Chris. This
helps me understand why my approach wasn't working in the first place.

I will take your advice and explore this further. I will probably have more
questions as I proceed to find a solution to meet my needs...

Thanks,
-Shayne

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert
Osfield
Sent: Monday, January 25, 2010 12:42 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] altering terrain texture...

Hi Shane,


There are a couple of texture policy settings in the
osgDB::DatabasePager that can tweak things a bit, but not generally:

        /** Set whether newly loaded textures should have their
UnrefImageDataAfterApply set to a specified value.*/
        void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef,
bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef;
_valueAutoUnRef = valueAutoUnRef; }

        /** Get whether newly loaded textures should have their
UnrefImageDataAfterApply set to a specified value.*/
        void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef,
bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef;
valueAutoUnRef = _valueAutoUnRef; }


        /** Set whether newly loaded textures should have their
MaxAnisotopy set to a specified value.*/
        void setMaxAnisotropyPolicy(bool changeAnisotropy, float
valueAnisotropy) { _changeAnisotropy = changeAnisotropy;
_valueAnisotropy = valueAnisotropy; }

        /** Set whether newly loaded textures should have their
MaxAnisotopy set to a specified value.*/
        void getMaxAnisotropyPolicy(bool& changeAnisotropy, float&
valueAnisotropy) const { changeAnisotropy = _changeAnisotropy;
valueAnisotropy = _valueAnisotropy; }



In the case osgTerrain::TerrainTile based paged database the above
settings won't work as it's osgTerrain that creates the osg::Texture
objects, so instead you'd need to modify the osgTerrain::ImageLayer
settings on the TerrainTiles.  A custom Registry::ReadFileCallback
could probably be implemented to do this for you.

Beyond this you could write a pre-processing tool to modify the .ive
files on disk.

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to