On 9/2/06, Raymond de Vries <[EMAIL PROTECTED]> wrote:
I hope you add this to osg. As I said before, I expect that some other
texture classes need the addition of setting the texture matrix with
scale 1,1,1 so these need some attention.
I have reviewed the changes but won't proceed with merging them as they you've tackled it will disrupt the texture coordinate managment well beyond just osg::TextureRectange usage.
The problem stems for wanting to ensure that the texture matrix modificiation are only local to the subgraph that is being decorated by the TextureRectangle state. The osg::State is designed to manage the proper inheritance of state, but only manage what it knows about, so state texture matrix state changed inside osg::TextureRectangle will be missed. I see you've tried to work around this by putting a resetting of the texture matrix in Texture2D, but this is won' work as general solution, even adding such a hack to all the Texture class won't sufficie as the texture matrix is something that is used by application for their own purpose, if we override this then we'll break these apps that rely upon texture matrix usage.
Original I thought perhaps just adding a texture matrix setting to TextureRectangle would suffice but alas I didn't spot all the problems above.
On reflection I think one workable solution would be to have the osg::TexMat class be able to have a special TextureRectangle section that allows you to tell it to watch a special osg::TextureRectangle, and to apply a texture matrix that it approrpriate for its current size. This route would require you to set the scene graph with this extra TexMat in the StateSet alongside the TextureRectangle, so scene graph set up would be a little more complicated, but at least it shoudl behave consistently, and will only require modifications to osg::TexMat and nothing else in the OSG.
I will go ahead with this implementation and see how things turn out.
Robert.
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
