gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.51k stars 780 forks source link

load 3dtiles error!!?? #2417

Closed arvrschool closed 6 months ago

arvrschool commented 10 months ago

The earth is white with nothing when i load my local 3dtiles file. there is the earth file:

/media/xxxx/文档/Works/Models/GIS/YSY_GIS/tileset.json

can you tell me why? The osgearth version is 3.5.0 Thanks very much~!

gwaldron commented 10 months ago

Not unless you attach your earth file and your tileset.json file.

arvrschool commented 10 months ago

Not unless you attach your earth file and your tileset.json file.

Thanks for your reply! My earth file is this:

<Map name="ReadyMap">
<CesiumNative3DTiles>
    <url>/media/xxxx/文档/Works/Models/GIS/YSY_GIS/tileset.json</url>
</CesiumNative3DTiles>
</Map>

and my 3dtiles file is big. so i just paste two tileset.json file: one is the root tileset, the another one is subdirectory file root path:tileset.json Data/Tile+000_+007 path:tileset.json

the imgui show this: _cgi-bin_mmwebwx-bin_webwxgetmsgimg__ MsgID=8887537498593581931 skey=@crypt_c57823ee_fa43a2ee97cffdaf213b0ef9fdd70742 mmweb_appid=wx_webfilehelper

plevy commented 10 months ago

Also paste any messages from the command window

arvrschool commented 10 months ago

Also paste any messages from the command window

only print these: void StateSet::setGlobalDefaults() ShaderPipeline disabled. void StateSet::setGlobalDefaults() ShaderPipeline disabled.

And how to turn on the log message?

arvrschool commented 9 months ago

CesiumAsync::Future<std::shared_ptr<CesiumAsync::IAssetRequest>>
AssetAccessor::get(const CesiumAsync::AsyncSystem& asyncSystem,
    const std::string& url,
    const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers)
{
    osg::ref_ptr<osgDB::Options> options = _options.get();
    auto request = std::make_shared<AssetRequest>("GET", url, headers);
    return asyncSystem.createFuture<std::shared_ptr<CesiumAsync::IAssetRequest>>(
        [&](const auto& promise)
        {
            asyncSystem.runInWorkerThread([promise, request, url, headers, options]() {
                // This should run in another thread.
                URIContext uriContext;
                for (auto header : headers)
                {
                    uriContext.addHeader(header.first, header.second);
                }
                printf("-----> AssetAccessor::get %s\n", url.c_str());
                URI uri(url, uriContext);

                auto httpResponse = uri.readString(options.get());
                std::unique_ptr< AssetResponse > response = std::make_unique< AssetResponse >();

                if (httpResponse.code() == ReadResult::RESULT_OK)
                {
                    response->_statusCode = 200;
                }
                printf("---> %d\n", httpResponse.code());
                response->_contentType = httpResponse.metadata().value(IOMetadata::CONTENT_TYPE);
                for (auto& i : httpResponse.metadata().children())
                {
                    response->_headers[i.key()] = i.value();
                }
                std::string content = httpResponse.getString();

                std::vector<std::byte> result(content.size());
                for (unsigned int i = 0; i < content.size(); ++i)
                {
                    result[i] = (std::byte)content[i];
                }

                response->_result = result;
                request->setResponse(std::move(response));
                promise.resolve(request);
                });
        }
    );
}```

In this function, i added two log print, this log is below:
_void StateSet::setGlobalDefaults() ShaderPipeline disabled.
void StateSet::setGlobalDefaults() ShaderPipeline disabled.
-----> AssetAccessor::get /media/matt/文档/Works/NV3D/Models/GIS/YSY_GIS/tileset.json
---> 0
-----> AssetAccessor::get https://api.cesium.com/v1/assets
---> 8_

Please give me some suggestions~
plevy commented 9 months ago

For more logging to the console, set the environment variable OSGEARTH_NOTIFY_LEVEL=INFO

arvrschool commented 9 months ago

Also paste any messages from the command window

The printed information is as follows, among them, "---> httpResponse.code()" was added by myself.

[osgEarth] Hello, world. [osgEarth] [Registry] Note: GDAL_DATA environment variable is not set [osgEarth] [Capabilities] osgEarth Version: 3.5.0 build 149 [osgEarth] [Capabilities] GDAL Version: 3.6.4 [osgEarth] [Capabilities] OSG Version: 3.7.0 [osgEarth] [Capabilities] OSG GL3 Features: no [osgEarth] [Capabilities] OSG FFP Available: yes [osgEarth] [Capabilities] CPU Cores: 24 [osgEarth] [Capabilities] GL_VENDOR: Mesa [osgEarth] [Capabilities] GL_RENDERER: llvmpipe (LLVM 15.0.7, 256 bits) [osgEarth] [Capabilities] GL_VERSION: 4.5 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1 [osgEarth] [Capabilities] GL CORE Profile: no void StateSet::setGlobalDefaults() ShaderPipeline disabled. void StateSet::setGlobalDefaults() ShaderPipeline disabled. [osgEarth] [Map] Map profile is: [srs=WGS84, min=-180,-90 max=180,90 ar=2:1 vdatum=geodetic] [osgEarth] [Map] [no cache] [osgEarth] [JobArena] Arena "cesium" concurrency=2 [osgEarth] [JobArena] Arena "cesium" concurrency=8 [osgEarth] [JobArena] Arena "oe.nodepager" concurrency=2 ---> httpResponse.code() 0 [osgEarth] [JobArena] Arena "oe.nodepager" concurrency=4 [osgEarth] [engine_rex] Activated! [osgEarth] [JobArena] Arena "oe.rex.loadtile" concurrency=2 [osgEarth] [JobArena] Arena "oe.rex.loadtile" concurrency=4 [osgEarth] [TerrainResources] Texture unit 1 reserved for Terrain Color [osgEarth] [TerrainResources] Texture unit 2 reserved for Terrain Elevation [osgEarth] [TerrainResources] Texture unit 3 reserved for Terrain Normals [osgEarth] [TerrainResources] Texture unit 4 reserved for Terrain Parent Color [osgEarth] [TerrainResources] Texture unit 5 reserved for Terrain Land Cover [osgEarth] [RexTerrainEngineNode] Creating 2 root keys. [osgEarth] [MapNodeHelper] Activating logarithmic depth buffer (vertex-only) on main camera ---> httpResponse.code() 8 [osgEarth] [JobArena] Arena "oe.rex.createchild" concurrency=2

gwaldron commented 6 months ago

stale - reopen if more info becomes available.