BabylonJS/Spector.js

Defining frame size

felipellrocha opened this issue · 8 comments

I'm rendering in a very non-traditional way that is not bound by raf, and, instead, I just .flush() at the end of my frame. Is there a way to define the framesize so that Spector can stop recording at that point?

not really, you could in your case capture a certain amount of commands instead ? you can actually do it within the extension with the capture button at the bottom by defining the amount of commands in the input text before
image

Since this PR you could also define your own function names to spy into https://github.com/BabylonJS/Spector.js/pull/259/files

I ll close it for now but feel free to create a PR if you needed extra customization for the spied functions ?

Yeah, I guess that works for debugging, but i kind of lost the ability to measure my fps since I made this latest change 🤔 Maybe the spying can work, though, I will give it a try. Does it work even if using wasm?

It only works on JS. I do not think you can "ducktype" on wasm that easily

Mmmmk :( Well, worth the shot. Thanks for the quick replies!

Really sorry to not be of much help here :-( the only other way would be to use the npm version and create your own UI to call startCapture and stopCapture manually from within your code: https://github.com/BabylonJS/Spector.js/blob/master/readme.md#basic-usage

That works!!! I would probably need to write a shim for calling Spector, but that isn't too bad... Do you guys have a .d.ts file I could use as a base?

Nope :-( still smthg I would need to tackle down #229

No worries. I'll take a look around! From experience of porting a JS project to TS, I recommend just porting it all to TS rather than try to maintain a .d.ts file. TS can autogenerate the .d.ts whereas maintaining a separate file can be a bit of a whack-a-mole situation. I wish I could say I had the time to open the PR. But, although that is unlikely, if i do have the time, I'll try to tackle that for you! :)