Problem loading texture on obj #2500
Unanswered
marcoma9023
asked this question in
Support Q&A
Replies: 1 comment
-
Try invoking the shader generator on your model when you load it: model = readRefNodeFile( "filename.osgb.osgearth_shadergen"); or osgEarth::ShaderGenerator gen;
gen.run(node); Also, you can use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
I'm writing because I'm facing the following problem:
in my application I need to use different .obj models at runtime, so I pre-load them as static variables:
static osg::ref_ptrosg::Node model = osgDB::readNodeFile(containerResourcesUrl + "/ModelResized/CargoShip/cargoMin.osgb");
the model needs to be georeferenced in osgEarth, so I put it in a tree logic like
ModeNode -> PositionAttitudeTransform->osg::Node
The problem lies in the fact that, sometimes (on some models and not always the same ones) the vertices and materials are loaded, while the textures are not loaded.
The curious aspect is that, for debugging, I loaded a test model with the same logic and at the same position as the model, but moved along the z axis and after several tests I noticed that in this case the texture problem does not occur. It seems to me as if in this way the "transverse" is forced on the model...
Can you help me?
Beta Was this translation helpful? Give feedback.
All reactions