GPGPU strange behavior on different hardware

Hi, I am trying to have a cloth simulated on the GPU. Everything works great on my computer, however when viewing from my phone I get some very strange behavior. Basically the cloth collapses into its center. I have implemented some constraints for edges which don’t collapse, but all of the free particles move toward the center. I have done some experimenting and I believe the problem is related to the difference in hardware between my phone and computer (different gpus). I am really at a loss of how to fix this problem though.

I am using floating point textures to control the points, and render to texture to update the positions. On the computer I get the following:

Which is correct. While on my phone I get:

I have done some debugging to make sure the constraints are correct for the cloth. But the problem is coming from when I constrain the vertices. I am out of ideas so any feedback or new ideas would be amazing.

Are you getting any error messages in the console on your phone?

It’s likely that your phone’s GPU doesn’t support all the necessary WebGL extensions that you scene is using. If this is the case then you will get an error message.

Thanks for the feedback. I went back and cleaned up all of the warning messages I was getting and the problem is still there.

https://afternoon-cliffs-70079.herokuapp.com/donut

thats a link to the page that is having the problem.

Here’s what it looks like on my android device, along with error messages. I’ve highlighted the relevant ones:

Untitled-1

Your demo does not work on my Laptop with Ubuntu (16.04 LTS), Chromium 63.0.3239.84 and a somewhat old Intel HD 4000. As you can see in the screenshot the cloth surfaces are totally flat. Unfortunately, i can’t see any warning or error messages in the console.

image

Does this GPGPU example work on your mobile phone?

https://threejs.org/examples/webgl_gpgpu_birds.html

The same on my Win7, Chromium 63.0.3239.84 and Intel® HD Graphics.

Thanks for the responses. I actually changed some code while debugging so it would look flat on all devices. I narrowed the problem down quite a bit. What is happening is that I am multiplying by a matrix in a shader then multiplying back by the inverse of that matrix (to tranform the point from local to world coords and then back). This is where things start getting weird. On my laptop it works fine, but on my phone it looks like things are not working as expected. But the physics for the surfaces are reenabled so if you run it, things should no longer look flat.

I don’t thing the matrix multiplication is the only problem though. I removed all of the update code (why it was a flat plane), and when running on my android device without the matrix and inverse in the code, it displayed fine, but with them, it flickers a bit.

I am getting a feeling that it is related to precision problems.

I actually get the same result if I change the type of my render targets on my computer from float to half floats