-
Notifications
You must be signed in to change notification settings - Fork 216
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
Artifacts, wrong display on Android and iOS #12
Comments
Interesting! I tested on my iPhone and it worked well. Can you say more about what mobile devices you uses and which versions of OS / browsers? |
Just in case you are interested in investigating the bug for mobile devices, I made this jsfiddle where it can be easier to see better where the problem could be: https://jsfiddle.net/3mxhsjn2/5/ result only: I used your demo from https://mapbox.github.io/webgl-wind/demo/ and replaced the real wind data images with a red only image, altered the json accordingly, now we have he same "west wind" everywhere... removed the map and also removed the "distortion" parameter so that the particles move same speed independent on "latitude". The result should be red particles moving left to right everywhere. It works on all desktop PCs I could try, but on mobiles the only device where I could view it correctly is a new Samsung Galaxy Tab S4, other mobile devices that I tried (iphone SE, iphone 7, ipad (even with latest ios 12...), Samsung Galaxy Tab A10.1, Galaxy S7 etc.. all show the strange blocky animation as on screenshot. Maybe it's rather hardware related? |
The error is linked with the conversion from color to pos and from pos to color in the file
If you remove all the code between this two operations you will see the particles converge to center on mobile/tablet and on desktop i will be immobile. |
Yes, this seems to suffer the similiar problems. webgl is a complete mystery to me yet ;) but link I found that might help to someone more experienced: ? |
Yep packing is wrong. |
Hi. Yes, This is not a solution use GPU. But I hope it helps people like me who have no other way than this source code. Here are the commits that contain my solution. |
Using the packing method from vhornik's link, and also Sly v's comment on the solution for iOS devices, I got it to work on an iPad as well. I changed the packing method (x on rg and y on ba), and used the rounding to fix the issue.
|
Great, this seems to work for me too (at least when I am testing Samsung Galaxy S10) original encode/decode with artifacts: msfstef's encoding/decoding: in the meantime, what worked for me was to actually use full RGBA to store each float coordinate
then I used 2 different textures to store particle positions, and used 2 update.frag shaders - one that writes the x the other y) |
@msfstef nice solution, thanks! It works on iPhone 6. I am used 2 drawcalls before this too. |
@msfstef Your solution was almost perfect, thanks a lot! I noticed though that resolution was good towards the top of the image, but coarser at the bottom. This can be fixed by updating both |
@guigrpa Use |
First, thanks for your great work!
![screenshot_20180915-163132_chrome](https://user-images.githubusercontent.com/11404633/45587485-7a717b80-b906-11e8-8bcd-3d2156c18646.jpg)
It works perfect on desktop but when I tried the demo in Chrome Android (also Safari on iOS, or Firefox on Android) the visualization is broken, with strange artifacts, particles are certainly moving differently and unrealistically then with the same wind image data on desktop. See screenshot from Android:
iOS shows similiar wrong image...
On desktop browsers the wind flow looks as expected:
![good-desktop-chrome](https://user-images.githubusercontent.com/11404633/45587500-ca504280-b906-11e8-88dd-58f0d3bec94b.jpg)
Screenshots come directly from https://mapbox.github.io/webgl-wind/demo/ (default setting) but I also tried the version from https://github.com/mapbox/webgl-wind/tree/mercator and it seems to have the same problems
The text was updated successfully, but these errors were encountered: