Hi Ken, <br>Basically you just need to setup a TextureSubloadCallback for your specific type of texture(1D,2D,3D).<br>This allows you to override the load and subload methods that you would encounter in gl. Then set the<br>
subloadcallback to your texture using:<br><br>Texture*D::setSubloadCallback(SubloadCallback* sb);<br><br><br>Overrides are something like the following:<br>load:<br>////////////////////////////////////////////////////////////////////////////////////
<br>void UpdateTextureCallback::load(const osg::Texture3D& texture,osg::State& state )const<br>{<br>      texture.getExtensions(state.getContextID(),false)->glTexImage3D(GL_TEXTURE_3D, 0,<br>                                          GL_RGBA,
<br>                                          _textureWidth,<br>                                          _textureHeight,<br>                                          _textureDepth,<br>                                          0, GL_RGBA,
<br>                                          GL_UNSIGNED_BYTE,<br>                                          (unsigned char*)_tm->dataField);<br><br>}<br>and subload :<br>//////////////////////////////////////////////////////////////////////////////////////////////
<br>void UpdateTextureCallback::subload(const osg::Texture3D& texture,osg::State& state) const<br>{<br> texture.getExtensions(state.getContextID(),false)->glTexSubImage3D(GL_TEXTURE_3D,<br>                     0,
<br>                     0,0,0,<br>                     _textureWidth,<br>                     _textureHeight,<br>                     _textureDepth,<br>                     GL_RGBA,<br>                     GL_UNSIGNED_BYTE,
<br>                     (unsigned char*)_tm->dataField);<br><br>}<br><br>You'll have to adjust this for your texture type (this is ours for 3D textures) but this should give you a general idea.<br>biv<br><div><span class="gmail_quote">
On 10/19/07, <b class="gmail_sendername">Sewell, Kenneth R Civ USAF AFRL/RYZW</b> <<a href="mailto:Kenneth.Sewell@wpafb.af.mil">Kenneth.Sewell@wpafb.af.mil</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Is there a good example of texture subloading in OSG?  I have a large<br>image and just want to replace small tiles of the texture.  Can anyone<br>give me a few starting pointers?<br><br><br>Ken.<br>_______________________________________________
<br>osg-users mailing list<br><a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br><a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
</a><br></blockquote></div><br>