[osg-users] Synchronizing with textures uploads.
Altin Gjata
altingjataj at gmail.com
Thu Mar 8 05:37:17 PST 2018
Thanks for the hints Laurens.
Indeed, I don't use DYNAMIC. I did in the beginning, but then I read that it hurts performance and commented it. This is the fragment of code:
Code:
bg_image_quad_ = createTexturedQuadGeometry(osg::Vec3(), width, height, image, true, true, false);
if (auto state = bg_image_quad_->getStateSet()) {
// as explained here: http://forum.openscenegraph.org/viewtopic.php?t=9004
// DYNAMIC has effect only when applied to StateSet or Drawable
// apparently DYNAMIC hurts performance, as said here:
// https://wiki.openmw.org/index.php?title=Rendering_Architecture
//state->setDataVariance(osg::Object::DYNAMIC);
//if (osg::ref_ptr<osg::Texture> texture = dynamic_cast<osg::Texture*>(state->getTextureAttribute(0, osg::StateAttribute::TEXTURE))) {
// if (auto myImg = dynamic_cast<ImageStream*>(texture->getImage(0))) {
// //texture->setDataVariance(osg::Object::DYNAMIC);
// }
//}
}
bg_image_camera_ = create_display_image_camera(*this, bg_image_quad_, true);
I'll try in these directions.
Thank you again.
Cheers,
Altin
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73047#73047
More information about the osg-users
mailing list