cedricpinson/osgjs — pull request #97 by Teybeo (2014-08-05 16:52:50+00:00)
Title: Add a proper path for re-generating mipmaps of a texture

When sceneTexture changed, we were setting calling dirty() on lumTexture, thinking it will cause the mipmap chain to be regenerated.
In fact, this caused the texture to take this path https://github.com/cedricpinson/osgjs/blob/develop/sources/osg/Texture.js#L357-L369.
There, the texture was reallocated and initialized to 0 (glTexImage2D(..., null)) so the following call to generateMipmap wasn't supposed to work, even if it did on several platforms.
This patch add a new special path if we only want to regenerate the mipmap chain.
Granted, it is a rare use-case so it might be done differently.