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

Screenshot? #22

Closed
ethanchiu10 opened this issue Sep 12, 2019 · 1 comment
Closed

Screenshot? #22

ethanchiu10 opened this issue Sep 12, 2019 · 1 comment

Comments

@ethanchiu10
Copy link

I'm having some trouble trying to do a toDataURL out of the canvas with the effects.

Inside a tock, I tried doing a renderPass with a material that takes in the system.tDiffuse and then draws it to system.renderTarget and then call toDataURL right after. It seems to work, but only for that one effect. If I chain multiple effects, the tDiffuse seems to only contain the original diffuse without any of the previous effects applied.

Do you have any tips on this?

And thank you so much for this great library btw.

@ethanchiu10
Copy link
Author

If anyone is stumbling on to this, here is a solution:

this.$el.sceneEl.systems.effects.tick(0, 0)
this.$el.sceneEl.systems.effects.tock()
let snapshot = this.$el.sceneEl.renderer.domElement.toDataURL('image/jpeg', 0.8)

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

1 participant