-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to get access to the pixels #6
Comments
Thanks for the report! I'd expect readback to be achievable with the API, even though we're defining the textures as opaque. Can you share a code snippet that'd demonstrate how you're attempting to access the pixels? Also, to make sure I understand: did the readback work for you in the past and no longer does? |
Hello Piotr. Thanks for your answer.
I checked again with the debugger, but couldn't find a way. Any suggestions?
After lots of experimentation (I'm not that good with WebGL), this is the function that worked in the end:
As it turned out, I had a difference between the old and new code for the camera access. When trying to access the pixels with the code above in the same requestAnimationFrame as the glBinding.getCameraImage() call, the resulting image is all black. To actually get the camera image, I have to run the glBinding.getCameraImage() already in an earlier requestAnimationFrame(). Bugreport in Chromium tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1233001#c2 |
Apologies for confusing phrasing, what I meant was that even though we hand out opaque WebGLTextures, normal (WebGL) ways of reading pixels should work, for example the I took a look at the code snippet you link to and compared it to our internal test case (lines 173-181 & I took over the bug in Chromium tracker to investigate this further. |
Thanks a lot. Still I would appreciate when there could be a more straightforward way in this spec to get access to the pixels. A related question if I may: It seems to me, that the dimensions of the returned image depend on the screen size of the device. Is that correct? Would be great to have some control over this. |
Hello.
I just worked on my code that used the camera-access as it was implemented until Chrome 91.
Access to the camera works it seems, as I can run the sample code provided at the Chromium site successfully. But I fail to get the pixels out of the WebGLTexture object returned by glBinding.getCameraImage() call now.
As WebGLTexture is described as an opaque texture object, I assume that accessing the pixels is not meant to work. But as computer vision is listed as one of the use cases in the explainer, I have the impression access to the pixels is necessary somehow.
Would be interested what the situation and plan is around this subject.
The text was updated successfully, but these errors were encountered: