Closed gwaldron closed 9 months ago
Note: This should be a simple matter of applying the "tether break realignment" code as necessary when setViewpoint happens
Pushed a patch for this to 79172142e, please test and report back.
Hi, I am sorry but cannot test it right away because, unfortunately, the latest release that gets along with my code is the osgearth-3.2. Now, I am trying to fix all the build errors... I will let you know asap. Thank you!
By commenting out here and there, I was finally able to build my code and I can confirm that the patch works flawlessly. Thanks! :+1:
I have a few side effects now (not caused by the patch, of course) because my linux application wasn't ready to move from GL2 to GL3 yet. For example, GL3 gave my models a new fresh coat of radioactive green paint... but I will figure it out eventually (any suggestions are very welcome 😄)
Try running the shader generator on your model.
osgEarth::ShaderGenerator gen;
gen.run(node);
I did, those lines were already there from a previous attempt to upgrade osgearth. Here's how I load a model:
void DifferentialUGV::loadModel() {
QDir localPath(QCoreApplication::applicationDirPath());
localPath.cd("../res");
auto resPath = localPath.absolutePath().toStdString();
osg::ref_ptr<osg::Node> body = osgDB::readRefNodeFile(resPath + "/OsgModels/CombatVehicle/CombatVehicle.osgt.osgearth_shadergen");
ugvGroup = new osg::Group();
ugvGroup->setName("Differential UGV Group");
ugvGroup->addChild(body);
osgUtil::Optimizer opt;
opt.optimize(ugvGroup, osgUtil::Optimizer::INDEX_MESH);
osgEarth::ShaderGenerator gen;
gen.run(ugvGroup);
if (pat.valid()) {
pat->addChild(ugvGroup);
}
if (root.valid()) {
optimizer.optimize(root);
}
}
I noticed that, at a specific yaw angle, the model becomes white and then it turns green again.
I have the same behavior if I load the cessna model from OpenSceneGraph-Data. On the contrary the cow.osgt file is rendered correctly, but it keeps printing the following warning messages:
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: TexGen::apply(State&) - not supported.
Warning: TexGen::apply(State&) - not supported.
Thank you! (I do not want to go off topic here... we can move to another discussion if you want)
@gwaldron, I moved the last comment to Support Q&A #2389, so you could close this issue. Thank you again for your support!
Discussed in https://github.com/gwaldron/osgearth/discussions/2380