DerKarlos / OSMeta

OSM "Metaverse"
Other
15 stars 2 forks source link

load uncompressed glb files from server #52

Closed oli-obk closed 10 months ago

oli-obk commented 10 months ago

no idea why web can't keep loading .gz files, so let's just stop loading them now that .glb files are available

DerKarlos commented 10 months ago

2023-12-01T09:23:53.127484Z ERROR bevy_asset::server: Failed to load asset 'tile://17435_11371.glb' with asset loader 'bevy_gltf::loader::GltfLoader': invalid glTF file: expected value at line 1 column 1

2023-12-01T09:23:53.214814Z INFO bevy_winit::system: Creating new window "App" (0v0)

2023-12-01T09:23:53.367947Z WARN osmeta::tilemap: failed to load tile [17435, 11371] from network, switching to flat tile

2023-12-01T09:24:23.415362Z ERROR bevy_asset::server: encountered an io error while loading asset: unexpected status code 500 while loading https://a.tile.openstreetmap.org/15/17435/11371.png: failed to lookup address information: nodename nor servname provided, or not known

2023-12-01T09:24:23.420794Z ERROR bevy_asset::server: Failed to load asset 'tile://17434_11371.glb' with asset loader 'bevy_gltf::loader::GltfLoader': invalid glTF file: expected value at line 1 column 1

oli-obk commented 10 months ago

That sounds like network/DNS issues, weird. I'm assuming opening that link in your browser works?

DerKarlos commented 10 months ago

Above was with empty cache. This is with some GLB but no Texture yet:

Who is doing the caching, Bevy assets or our src/http_assets.rs? Let's add some info!()

It looks like the cash read is ok, this code in "read" is used: let file = File::open(&cache_path).await?; info!("file: {:?}", file); return Ok(Box::new(file) as Box);

The File existed!: file: File { fd: 4, path: "/Users/karlos/Library/Caches/org.osmeta.OSMeta/17435_11371.glb", read: true, write: false } ERROR bevy_asset::server: Failed to load asset 'tile://17435_11371.glb' with asset loader 'bevy_gltf::loader::GltfLoader': invalid glTF file: expected value at line 1 column 1 WARN osmeta::tilemap: failed to load tile [17435, 11371] from network, switching to flat tile

The error is in the Bevy loader. Could be debugged anyway. I just never managed to debug Rust with breakpoints.

More log, with debug! enabled: 023-12-01T15:54:08.691581Z INFO osmeta::http_assets: write: "/Users/karlos/Library/Caches/org.osmeta.OSMeta/17432_11372.glb" 2023-12-01T15:54:08.693657Z DEBUG log: Buffer (114, 4, Metal) map state -> Idle
2023-12-01T15:54:08.693729Z DEBUG log: buffer (114, 4, Metal) is dropped
2023-12-01T15:54:08.694001Z INFO log: Created buffer Valid((87, 11, Metal)) with BufferDescriptor { label: None, size: 112, usage: BufferUsages(COPY_DST | UNIFORM), mapped_at_creation: true }
2023-12-01T15:54:08.694907Z ERROR bevy_asset::server: Failed to load asset 'tile://17432_11372.glb' with asset loader 'bevy_gltf::loader::GltfLoader': invalid glTF file: expected value at line 1 column 1 2023-12-01T15:54:08.706124Z WARN osmeta::tilemap: failed to load tile [17432, 11372] from network, switching to flat tile 2023-12-01T15:54:08.706345Z DEBUG bevy_ecs::world::entity_ref: Despawning entity 38v0 2023-12-01T15:54:08.713546Z INFO osmeta::http_assets: READ: "/Users/karlos/Library/Caches/org.osmeta.OSMeta/17434_11368.glb" 2023-12-01T15:54:08.713583Z DEBUG osmeta::http_assets: dddddddddddddddddddddddddddddddddddd 2023-12-01T15:54:08.714502Z DEBUG log: Buffer (87, 11, Metal) map state -> Idle
2023-12-01T15:54:08.714623Z DEBUG log: buffer (87, 11, Metal) is dropped
2023-12-01T15:54:08.715626Z INFO osmeta::http_assets: after return 2023-12-01T15:54:08.715754Z INFO log: Created buffer Valid((88, 11, Metal)) with BufferDescriptor { label: None, size: 4, usage: BufferUsages(COPY_DST | STORAGE), mapped_at_creation: true }
2023-12-01T15:54:08.715786Z DEBUG log: Buffer (88, 11, Metal) map state -> Idle
2023-12-01T15:54:08.716360Z INFO log: Created buffer Valid((101, 9, Metal)) with BufferDescriptor { label: None, size: 58752, usage: BufferUsages(COPY_DST | STORAGE), mapped_at_creation: true }
2023-12-01T15:54:08.716402Z DEBUG log: Buffer (101, 9, Metal) map state -> Idle