Closed gwaldron closed 4 months ago
What version of Cesium Native are you using? Try using git sha 952b17446b960190b2989085b7bdb23f4ccb2d27 of Cesium Native if you would and report back, that is what I was testing against.
Hello, I tested the versions cesium-native 0.24-0.29, they all produced errors. My error occurred in the releaseReference of the ReferenceCounterNonThreadSafe file in Cesium-Native.
I initially estimated that it was a multi-threading error, because Openthread will generate multi-threading when calling osg, so after creating the osgviewer, I added viewer->setthreadingmodel(osgviewer::viewerbase::singlethreaded). This line solved the reporting error problem.
In addition, I also found that using osgearth 3.5 to load 3dtiles without any textures would also report errors. Therefore, I modified the code for generating 3dtiles textures in the source code, and finally successfully loaded the 3dtiles. Since I'm just a student with limited programming skills, although I solved the problems I encountered when using Osgearth, the solutions may be wrong, just for your reference. The attached figures show my thread error location and adjustments to the source code. Thank you for your reply.
@ChahuaP says: Hello, I'm using osgEarth 3.5 and Cesium-native to visualize local 3D Tiles files in osgEarth. However, during the usage, when I try to load 3D Tiles with my code, the program throws an error "Assertion failed: std::this_thread::get_id() == this->_threadID, file G:\download\cesium-native-0.24.0\CesiumUtility\include\CesiumUtility/ReferenceCountedNonThreadSafe.h, line 60". My code is as follows:
auto cesiumLayer = new osgEarth::Cesium::CesiumNative3DTilesLayer; cesiumLayer->setURL("G:/download/cesium-native-0.24.0/Cesium3DTilesReader/test/data/tileset.json"); mapNode->getMap()->addLayer(cesiumLayer);
I hope to receive your assistance,thank you.
Originally posted by @ChahuaP in https://github.com/gwaldron/osgearth/discussions/2364#discussioncomment-7455329