Skip to content
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

Defining frame size #268

Closed
felipellrocha opened this issue Jun 26, 2023 · 8 comments
Closed

Defining frame size #268

felipellrocha opened this issue Jun 26, 2023 · 8 comments

Comments

@felipellrocha
Copy link

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?

@sebavan
Copy link
Member

sebavan commented Jun 26, 2023

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 ?

@sebavan sebavan closed this as completed Jun 26, 2023
@felipellrocha
Copy link
Author

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?

@sebavan
Copy link
Member

sebavan commented Jun 26, 2023

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

@felipellrocha
Copy link
Author

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

@sebavan
Copy link
Member

sebavan commented Jun 26, 2023

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

@felipellrocha
Copy link
Author

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?

@sebavan
Copy link
Member

sebavan commented Jun 26, 2023

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

@felipellrocha
Copy link
Author

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! :)

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

No branches or pull requests

2 participants