osgearth icon indicating copy to clipboard operation
osgearth copied to clipboard

load 3dtiles error!!??

Open arvrschool opened this issue 5 months ago • 7 comments

The earth is white with nothing when i load my local 3dtiles file. there is the earth file: <Map name="ReadyMap"> <CesiumNative3DTiles> /media/xxxx/文档/Works/Models/GIS/YSY_GIS/tileset.json </CesiumNative3DTiles> </Map> can you tell me why? The osgearth version is 3.5.0 Thanks very much~!

arvrschool avatar Jan 09 '24 15:01 arvrschool

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

gwaldron avatar Jan 09 '24 16:01 gwaldron

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 sub_directory 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

arvrschool avatar Jan 10 '24 14:01 arvrschool

Also paste any messages from the command window

plevy avatar Jan 10 '24 21:01 plevy

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 avatar Jan 11 '24 14:01 arvrschool

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~

arvrschool avatar Jan 12 '24 16:01 arvrschool

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

plevy avatar Jan 17 '24 00:01 plevy

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

arvrschool avatar Jan 27 '24 01:01 arvrschool

stale - reopen if more info becomes available.

gwaldron avatar Apr 23 '24 12:04 gwaldron