-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rendering to <canvas> element? #3
Comments
Hi, to render to a canvas would require a second WebGL context (i.e. a 2nd One of the things I deliberately tried to do with this set of components was to avoid the need for multiple WebGL contexts, as described here: In your case, it sounds as though you actively want an additional canvas & hence you'll need an additional WebGL context, since each In that case, I think you would be better off using the code from jgbarah's camrender.js, rather than trying to adapt these components? Is there a reason that doesn't work for you? |
I've fiddled around a bit more and found that the canvas element actually gets rendered to (if I move it out of |
Update: yes, it works with |
When you do this, I think is not actually rendering to the 2nd canvas. Rather, it is rendering to a section of the original canvas that is defined by the boundary of the 2nd canvas. |
Just tested your component with my a-frame 1.4.1 scene and it works like a charm, kudos!
However, for my somewhat esoteric usecase, I'd like to render the output of the second camera to a
canvas
element (just like in https://jgbarah.github.io/aframe-playground/camrender-01/ ). Unfortunately, that doesn't seem to do anything. I verified that aframe-multi-camera itself works, using an extra plane, but I need something that I can use to create aMediaStream
object from, and that has to be acanvas
.My setup:
When I change the second camera options to
"output:plane; outputElement:#testplane; sequence:before"
, I get the expected result rendered to the plane, but with the code above, the canvas stays unchanged. Any ideas about how to fix this?Thanks!
The text was updated successfully, but these errors were encountered: