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

Problem running on mobile platforms #11

Open
dav1dsm1th opened this issue Apr 10, 2018 · 1 comment
Open

Problem running on mobile platforms #11

dav1dsm1th opened this issue Apr 10, 2018 · 1 comment

Comments

@dav1dsm1th
Copy link

The behaviour of the water is different when running on mobile hardware compared to what is seen on desktop h/w.

On desktop, the movement of the water is dampened over time and relatively quickly returns to a smooth surface.

On both ios and android the surface appears to be perturbed by additional velocities which stop the water from ever settling back to a smooth state.

One obvious difference is that the pixel ratio, when run on the desktop h/w, is 1.0 but on the mobile h/w it varies (on the examples I have tried it on) - 2.0 on an iPhone and 2.75 on an Android. Not sure if this is related - but it struck me that the "averaging of neighbour pixels" may be looking "further away" than expected and picking a velocity that is higher than an immediate neighbour - causing the wrong average to be calculated. But that's a wild stab in the dark.

I'm struggling to debug the shaders - to compare the actual calculated values on the different h/w - but I'll continue trying...

Any thoughts/fixes would be appreciated.

@dav1dsm1th
Copy link
Author

I looked into the pixel ratio and it doesn't get passed to the shaders - so that's a red herring.

It's as if the precision of the storage of a float is lower on mobile.

I found https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices

Which makes reference to issues with highp - which hints that precision may be different on mobile. I'll keep stumbling around for now.

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