Skip to content

Add buffer data capture and buffer data view - #396

Open
Emily-TTG wants to merge 4 commits into
BabylonJS:masterfrom
Emily-TTG:master
Open

Emily-TTG wants to merge 4 commits into
BabylonJS:masterfrom
Emily-TTG:master

Conversation

@Emily-TTG

Copy link
Copy Markdown

[Note that this pretty much requires the application to startCapture manually so that buffer uploads are actually seen]

Add functionality to capture buffer contents and allow their viewing via. the relevant draw call -- similar to Renderdoc's buffer/resource view functionality. Formats the buffer by the bound attributes at draw time to keep things nice and readable.

In future it might be nice to also support WebGL2 buffer readback for getting pre-record buffer data but this WebGL1 impl is more of a catchall initial impl.

My actual frontend skills aren't great so if there's something wrong with the visual design I've left Allow edits by maintainers on.

New button on draw call view:
The draw call attributes view with `View buffer` highlighted on a vertex position attribute

A view of the contents of the vertex position buffer broken down into X/Y/Z components

@sebavan

sebavan commented Sep 28, 2026

Copy link
Copy Markdown
Member

Can you limit the buffer capture to the first few elements ? let s say 16 ?

@Emily-TTG

Emily-TTG commented Oct 3, 2026 •

Copy link
Copy Markdown
Author

@sebavan that seems like it'd kind of defeat the purpose of having a buffer view no? I can add a setting to limit the max capture length but I was just following the RenderDoc pattern of "capture everything". Would it be preferable that go into extension settings with an override in the spector object or?

@sebavan

sebavan commented Oct 5, 2026

Copy link
Copy Markdown
Member

Capturing the buffers was asked to not be present by a few websites in the past. It might not be relevant anymore but I recall they were people scared by such an easy access to their full meshes:

#294

@Emily-TTG

Copy link
Copy Markdown
Author

I suppose? Could the application maybe require an opt-in on it then via ._allowBufferCapture or similar on the context object -- so websites that don't want stuff yoinked can't easily be scraped without some extra work to inject JS.

I do appreciate this is a concern -- RenderDoc kind of assuages it by just saying it's against the usage supported by the RenderDoc project but I can see how that might be flimsy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants