-
Notifications
You must be signed in to change notification settings - Fork 662
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
strange canvas output if graphical is true on chrome for android #521
Comments
I believe this is the highest priority. I'm away right now but curious if using |
Hi,
Produces the exact same image like above. |
Try setting the tactic to |
Yay, that's working! Huawei, Samsung and Iphone is now okay. The other device (Blackview A10 Android 7.0) doesn't work. Is it possible to determine in which specific cases these settings should be applied? |
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices mentions that // Edit: Perhaps it is better to use integers rather than floats where possible (although I have no idea how to specify types with this library)? I'd assume these accuracy issues would then disappear. |
I'll have a good chunk today I can look into this and resolve it, fyi. |
This has to be related: mapbox/webgl-wind#12 |
Have a fix, will have this added later today. |
...it kind of snowballed from some needs Fixes gpujs#521 - If `tactic` is not set, check precision allowed from WebGL, and automatically change based off needs, otherwise use value from `tactic`. Fixes gpujs#535 - Internally check if texture from argument is the same as output, if so, clone this texture, and then clean it up after the kernel runs. Fixes gpujs#536 - Normalize all declarations to non-destructured, and then parse Fixes gpujs#537 - Change logic Fixes gpujs#538 - Found the GL script that would work, and reduced the methods to use it Fixes gpujs#539 - Found a better way of testing random, and this gives me an error for 1 in 10 runs, acceptable Some refactoring for less duplicate code and documentation
What is wrong?
I tried to run your yellifish canvas direct draw example on my mobile phone (Samsung Galaxy S7) with latest Android updates. If CPU mode is enabled everything works like expected (slow). If I enable the GPU the output is shuffled. It seems like the texture coordinates are shifted.
![screenshot_1](https://user-images.githubusercontent.com/16139246/67157780-4f3f3400-f331-11e9-97c6-8ed653f0a58a.jpg)
![screenshot](https://user-images.githubusercontent.com/16139246/67157806-ae04ad80-f331-11e9-9c75-c1adf6f3e44a.jpg)
expected (cpu):
observed (gpu):
I tried another example where an color gradient is drawn directly to the canvas. Same behavior on this specific device.
![screenshot_2](https://user-images.githubusercontent.com/16139246/67157982-c4f7cf80-f332-11e9-8500-6b83934524da.jpg)
![screenshot_3](https://user-images.githubusercontent.com/16139246/67157993-f2447d80-f332-11e9-9cd7-21a644b133a7.jpg)
expected (cpu):
observed (gpu):
Where does it happen?
Chrome for Android on my Samsung Galaxy S7. Didn't try another Android Device. Can try it tomorrow. Linux Desktop works like expected.
How do we replicate the issue?
If you have such a device, you can use the Yellifish Video example. Or you can use the second example below:
How important is this (1-5)?
5 (my subjective importance) because I cannot use gpu.js for my project with this behaviour. I want to apply video effects to the device camera. Without this behaviour the performance of gpu.js would be great for this project. It is an awesome library! Thanks for that! :)
Expected behavior (i.e. solution)
There seems to be an anomaly in the canvas output of this (maybe more) devices. It is not the input because of the second test (computed output). It seems like there is a special planar color space in the output texture, so that the uv-mappings doesn't apply to this device (only a slight guess). I have tried other THREE.js video texture examples on this device to proof it is possible and no hardware related problem. The examples i found worked like expected.
Other Comments
Thank you for this great library!
The text was updated successfully, but these errors were encountered: