-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Designer rendering research/prototyping #298
Comments
After doing some research, it looks like SVG starts to break down around 1000 elements, which is quite low in our case. I'll probably want to start looking at other options for WebGL/DOM integration as it seems like we may not have much of a choice |
Ultimately this isn't an issue specific to RNA2D - it affects RNA3D as well, and really doesn't have much to do about the performance of RNA2D itself at this point (since we've determined SVG won't cut it) but more generally handling interlaced HTML/WebGL content. I started looking into this, and found a few resources:
Eventually I stumbled across https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas#synchronous_display_of_frames_produced_by_an_offscreencanvas - this shows a pattern of using OffscreenCanvas.transferToImageBitmap and a canvas with a bitmaprenderer context, which is supposed to allow for transferring image data without a readback from the GPU to CPU. Now Safari doesn't support OffscreenCanvas, but createImageBitmap can create an ImageBitmap directly from a regular WebGL canvas, which should have the same benefits. I used a modified version of the PixiJS Bunny Mark application to test this out, and with 10k bunnies, splitting the image across 16 canvas elements:
Turns out, Firefox incurs readbacks when generating |
I'm throwing this under designer-hud since at this point I'm considering this largely in terms of its impact with the windowing system |
Investigating virtual-webgl gave me the idea that maybe passing the webgl canvas to a Context2D's drawImage would work instead, but same problem exists there, with a related open bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1163426 |
Due to the complexity of interoperation between canvas and DOM, we want to explore the viability of an SVG-based 2D RNA visualization. In particular, there are concerns around the performance of animations with large numbers of bases.
NB: We probably still have to deal with Canvas for RNA3D, which means we probably still need to think through how interop needs to work.
The text was updated successfully, but these errors were encountered: