Closed nebsar closed 2 years ago
Try using the osgEarth ShaderGenerator when you load external models. You can either run it manually with
ShaderGenerator gen;
gen->apply(node);
or you can use the pseudo-loader extension:
osgDB::readRefNodeNode("mymodel.osg.osgearth_shadergen");
Unfortunately, some of OpenSceneGraph's fixed-function attributes will dump messages to the console when FFP is not supported, and you cannot turn them off with disabling all console output or by modifying OSG directly.
I don't know much about OSG's particle system but unless it's shader-based it likely will not work with osgEarth without some adaptation.
I applied the recommended method, but it did not work. As follows:
osg::ref_ptr
Please explain "did not work."
Same messages are still dumped
I also tried : osgEarth::Registry::shaderGenerator().run(model3d); But same result.
Read the docs on PolygonMode.
Must be GL_FRONT_AND_BACK for front- and back-facing polygons.
Ok, I am sorry. Now it worked. I was using outline for the model. And that was causing the message dump. When I removed the outline it started working.
Ok never mind. I am still trying to learn. I read the document you shared and adjusted the code. I have my outline again. Most probably, if do the same modification for the particle system, it will work. Thanks Glenn.
Glad you got it working :)
By the way, I rebuilt the OSG removing the codes that includes materials from the Particle System. Then I used osgEarth's shader generator. Particle system worked well and no dumped messages to console from OSG. Here is the image.
amazing!
When I try to load 3D models such as .obj, 3ds, and when I use particle system, I get the following warning repeatedly:
Warning: PolygonMode::apply(State&) - only GL_FRONT_AND_BACK is supported.
Is this because GL3 build does not support materials and other stuff? What can be the solution to this?