[osg-users] setUseVertexAttributeAliasing and frame buffer objects not working together

Chris Kuliukas chris at kuliukas.com
Mon Mar 28 20:33:26 PDT 2016


Wow, can't believe my luck at stumbling into the solution for this so quickly..


Code:
	osgViewer::Viewer::Windows windows;
	viewer.getWindows(windows);
	for(osgViewer::Viewer::Windows::iterator itr = windows.begin();
		itr != windows.end();
		++itr)
	{
		osg::State *s=(*itr)->getState();
		s->resetVertexAttributeAlias(false, 8); // <-- This line
		s->setUseModelViewAndProjectionUniforms(true);
		s->setUseVertexAttributeAliasing(true);
	}




Here is a before / after: http://imgur.com/a/aWoKB


It looks like if you use vertex attribute aliasing it compacts the uniform slots by default, which screws up all fixed transform stuff (which I guess expects them to be in their usual spots). 
s->resetVertexAttributeAlias(false, 8); prevents it from compacting the uniform slots, and it all works.

------------------------
http://www.hrwallingford.com/facilities/ship-simulation-centre (http://www.hrwallingford.com/facilities/ship-simulation-centre)

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








More information about the osg-users mailing list