Giter VIP home page Giter VIP logo

Comments (8)

kring avatar kring commented on June 11, 2024

I noticed that changing the Maximum Cached Bytes property from 268435456 (256MiB) to 26843545600 (25600MiB) makes the problem go away. So the problem does seem to be that tiles are being unloaded when you look away due to the cache size being exceeded, but I'm not sure why.

from cesium-unreal.

kring avatar kring commented on June 11, 2024

Turns out I was wrong about how the tile data size is measured for cache purposes. It's actually formed by adding up the number of bytes in all of the glTF buffers (cesium.data.size()) and images (cesium.pixelData.size()). That is after things like Draco and JPG decompression, so it can be a lot larger than the size of the data downloaded over the network (even after it is gunzipped). A single 256x256 JPG ends up being 341KiB.

from cesium-unreal.

csciguy8 avatar csciguy8 commented on June 11, 2024

Interesting. So given my previous example of a 40MB SQLite cache... If I imagine it was filled solely with JPGs, and we have a typical JPEG compression ratio of 10:1, they would expand to ~400MB in memory. This is clearly over my cached bytes setting of 256MB, so maybe everything is working as designed?

If so, maybe it's just a matter of usability with Maximum Cached Bytes? Or maybe my expectations were just wrong?

from cesium-unreal.

kring avatar kring commented on June 11, 2024

Right, for that Googleplex scene, the actual size of the traversed tiles is about 300 MiB. I'm still trying to be 100% certain it's correct, but I think it is. In which case the default 256MiB max cache for Google Photorealistic 3D Tiles is simply too small.

from cesium-unreal.

csciguy8 avatar csciguy8 commented on June 11, 2024

Ok, if that's true, then my expectations were just wrong.

But this problem could lead to more work with this feature. For example, a new "auto" setting that determines a reasonable size based on your system memory or some other metrics. We could still have a fixed memory size for users that know exactly their device constraints.

from cesium-unreal.

kring avatar kring commented on June 11, 2024

For comparison, the default in CesiumJS is 512MiB. It's not clear why ours is half that. Part of the reason may be that we're assuming there are extra copies kicking around in memory. cesium-native maintains a copy of all the tile data in the glTF data structure that isn't used at all for rendering. The game engines maintain the copy for rendering, of course, but may also maintain their own CPU-side copy as well.

from cesium-unreal.

kring avatar kring commented on June 11, 2024

The Unreal "Memory" stat doesn't seem to work at all for showing our texture memory usage. If I set the cache size huge and fly around, the static mesh memory goes up steadily, as you'd expect. But the texture memory usage doesn't change at all.
image

Perhaps our custom texture upload code is somehow evading UE's texture memory performance counter? 😬

from cesium-unreal.

kring avatar kring commented on June 11, 2024

Perhaps our custom texture upload code is somehow evading UE's texture memory performance counter?

Yes, this. If I force it to use the legacy texture upload path, the texture memory usage is much more realistic:
image

from cesium-unreal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.