USNavalResearchLaboratory / simdissdk

SIMDIS SDK
Other
114 stars 39 forks source link

The osg particle effect is not displayed #74

Closed yuxiangyu closed 2 years ago

yuxiangyu commented 2 years ago

When we used simdissdk , we suddenly found that the paricle system used in osg/osgearth application can not work. Can someone tell me the reason?

emminizer commented 2 years ago

Do you have sample code or more details? There is not enough information to give any suggestions here. We do not use the particle system regularly and there's no known incompatibilities.

I was under the impression that osgParticle was all but deprecated, quite old and using older, slower methods for particle display. The OSG binaries in our third party pack are built with core profile enabled for maximum support on e.g. VMs; it's possible there could be some conflict there between osgParticle and core profile if that's the case.

yuxiangyu commented 2 years ago

just a simple fireEffect as: osg::ref_ptr fe = new osgParticle::FireEffect(postion,100.0,100.0); In the osgEarth application it can be displayed as image but in the simdissdk application , it did not show any effect

emminizer commented 2 years ago

Best guesses:

I'm not familiar with osgParticle, and we don't use it. My only real experience is from issues like https://github.com/openscenegraph/OpenSceneGraph/pull/900#issuecomment-576212703 where Robert states:

doing particle systems on the CPU is pretty daft these day so I really consider osgParticle really just there for backwards compatibility so don't see it as something we should invest time in trying to perfect and risk breaking when users really should be implementing particle systems on the GPU on modern hardware

This is part of why we have not investigated osgParticle. However if there's some change on our end that you see that can help, we're interested to hear. Thanks!

yuxiangyu commented 2 years ago

Thanks a lot for your proposal.

yuxiangyu commented 2 years ago

Maybe I have found the key of the problem that the particles effect generated by osg can only be added child under the root node for an unknown reason like that: osg::ref_ptr trans = new osg::MatrixTransform; ... osg::ref_ptr pe = new osgParticle::PrecipitationEffect; ... trans->addChild(pe); viewer->getMainView()->getSceneData()->asGroup()->addChild(trans);

emminizer commented 2 years ago

Thank you for sharing the possible workaround. That seems less convenient than adding as a child in the proper location in the scene, but at least seems workable.