Re: [osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?
I took the coward's way out before and manually changed the min and mag filter settings in the VPB src to accomplish this task. This worked in a pinch but I'd like to get back on the VPB trunk and learn how to do this the right way. Any advise on how to search an entire PagedLOD terrain complex with many levels in order to change the min and mag filters for the textures? I've been converting .ive files to .osg to inspect their structure and see that what I need to do is to visit every osgTerrain::ImageLayer within each ColorLayer of each TerrainTile within the entire terrain complex and then set each of the ImageLayer's MinFilter and MagFilter to my desired setting of NEAREST. I tried creating a NodeVisitor to accomplish this task but realized that it would only traverse the top level of the terrain and would not visit the child .ive files (I think this is because of the PagedLOD structure). I looked for how to traverse a PagedLOD and found this thread: http://forum.openscenegraph.org/viewtopic.php?t=5146 but before I go too far in any one direction I figured I'd ask here to see if somebody can point me in the right direction. As always, my sincere thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51622#51622 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?
It looks like what I might need is the code from the fourth post on this page: http://forum.openscenegraph.org/viewtopic.php?t=2130 My current NodeVisitor is very similar to this, I just wasn't familiar with using the osgDB::Registry::instance()-readNodeImplementation() part of the code and have only ever used the osgDB::readNodeFile method. I'll see if I can get this working, though I don't yet understand why this Registry readNodeImplementation part is necessary... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51623#51623 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?
And if it's not possible, is there any way to change the filters once I've read a terrain.ive file into an osg project? I've seen this code snippet: Code: osg::osg::Node* terrain = osgDB::readNodeFile(terrain.ive); osg::Texture2D* tex = new osg::Texture2D; tex-setFilter(osg::Texture::MIN_FILTER, osg::Texture::NEAREST); tex-setFilter(osg::Texture::MAG_FILTER, osg::Texture::NEAREST); terrain-getOrCreateStateSet()-setTextureAttribute(0, tex.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); but that creates a new texture2d object that overwrites all of my other textures instead of just changing the filter type. Any advice on this? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46441#46441 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?
HI Ethan, Texture filter is controlled per osg::Texture, you can't override the filtering without overriding a the texturing. If you want to modify the filtering of the textures that an osgTerrain based database they you'll need to load the scene graph then search the scene graph to locate the TerrainTile, from these you can get the color layers, and each of these layer with have the MinFilter and MagFilter. Robert. On 20 March 2012 14:38, Ethan Fahy ethanf...@gmail.com wrote: And if it's not possible, is there any way to change the filters once I've read a terrain.ive file into an osg project? I've seen this code snippet: Code: osg::osg::Node* terrain = osgDB::readNodeFile(terrain.ive); osg::Texture2D* tex = new osg::Texture2D; tex-setFilter(osg::Texture::MIN_FILTER, osg::Texture::NEAREST); tex-setFilter(osg::Texture::MAG_FILTER, osg::Texture::NEAREST); terrain-getOrCreateStateSet()-setTextureAttribute(0, tex.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); but that creates a new texture2d object that overwrites all of my other textures instead of just changing the filter type. Any advice on this? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46441#46441 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?
Hello, I've played around with the --no-interpolate-imagery and --no-mip-mapping flags to see how they are affecting the texture filters but haven't found a way to set them to NEAREST. Is this possible using a flag in osgdem? Thanks, -Ethan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46262#46262 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org