threejs / three-devtools

three.js devtools

Home Page:https://chrome.google.com/webstore/detail/threejs-developer-tools/ebpnegggocnnhleeicgljbedjkganaek

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[meta] Handle large assets/scenes

jsantell opened this issue · comments

This broadly needs more investigation.

  • An object with many children can jank the tree view
  • Refreshing some objects may cause a new toJSON() cycle in content, potentially causing large amounts of jank from serializing and sending giant strings of textures or buffers
  • Right now an entire scene is serialized on first request; should there be a difference between requesting the "overview" of an entity and the "data" (e.g. potentially very large base64 strings or buffers), and access the larger data lazily when needed?
  • If we wanted to modify the built in toJSON method for some type, like to only serialize the first n children, is there a way to do that without having to duplicate/rewrite the serialization logic for objects, materials, textures, etc...
  • Are we conservative in sending data over the wire? I think there's a duplicate request somewhere at least.
  • In the devtools, a comparison occurs to determine whether or not to emit an 'update' event -- can this be moved to the content and get rid of unnecessary wire transfers?

With enough textures or vertices, postMessage's limit can be reached:

contentScript.js:32 Uncaught TypeError: Error in invocation of runtime.sendMessage(optional string extensionId, any message, optional object options, optional function responseCallback): Message length exceeded maximum allowed length.

https://threejs.org/examples/webgl_performance_static.html has 7700 children and no textures/models for a good test case

Now handled, explained #43 (comment)