It sounded like nobody was opposed to this update, so here is the code. I didn't change the value of SHARE_ALL for the sake of backward compatibility even though it probably should be different. I still consider that possibility open for discussion.
Per Robert's suggestion, the default share mode was SHARE_TEXTURES and is now SHARE_STATIC_TEXTURES | SHARE_UNSPECIFIED_TEXTURES. I'm not sure why textures were the default share mode instead of StateSets. Maybe the original author will comment on that? I kept SHARE_TEXTURES equal to SHARE_STATIC_TEXTURES for backward compatibility, and did the same for StateSets. After doing this I think SharedStateManager could be expanded a lot, but I don't know how much it would help performance. For example, you could share individual StateAttributes instead of whole StateSets. More specifically, a StateSet is not equal to another StateSet if only its texture is different. Seems like there would be a lot of opportunities in typical OSG usage to share most attributes in StateSets that only differ by their texture. - Terry
SharedStateManager.tar.gz
Description: GNU Zip compressed data
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
