Hi Micael, You can use a osg::Texture2D::SubloadCallback to override the load and subload methods.
Robert. On 3 November 2011 04:39, Micael Levesque <[email protected]> wrote: > Hi, > > I'm working on implementing VBSP lightmaps to OSG but I've come across a > problem, I'm not able to copy the image data the way I used to in this > function: > > > Code: > Vector2 insert(int id, const Vector2& size, const BSPFile::LightmapLuxel* > luxels) > { > BSPLightmapNode* lightmapNode(lightmapNodeRoot.insert(size)); > if(lightmapNode != NULL) > { > glBindTexture(GL_TEXTURE_2D, handle); > const Vector4& rect(lightmapNode->rect); > glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.z - 1, rect.w - 1, > GL_RGBA, GL_UNSIGNED_BYTE, luxels); > lightmapNode->empty = false; > return Vector2(rect.x,rect.y); > } > else > { > return Vector2(0,0); > } > } > > > > I've looked around for the OSG alternative to this method but I've not found > anything useful. The osg::Image::copySubImage() function seems to be the > right way to go but I can't find a way to have the same control over offsets > has glTexSubImage2D() :? > > Thank you! > > Cheers, > Micael[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=43700#43700 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

