{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/13288","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/13288/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/13288/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/13288/events","html_url":"https://github.com/mrdoob/three.js/issues/13288","id":295964637,"number":13288,"title":"SkinnedMesh bug when far from scene root (0,0,0)","user":{"login":"OrtOfOn","id":917547,"avatar_url":"https://avatars2.githubusercontent.com/u/917547?v=4","gravatar_id":"","url":"https://api.github.com/users/OrtOfOn","html_url":"https://github.com/OrtOfOn","followers_url":"https://api.github.com/users/OrtOfOn/followers","following_url":"https://api.github.com/users/OrtOfOn/following{/other_user}","gists_url":"https://api.github.com/users/OrtOfOn/gists{/gist_id}","starred_url":"https://api.github.com/users/OrtOfOn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrtOfOn/subscriptions","organizations_url":"https://api.github.com/users/OrtOfOn/orgs","repos_url":"https://api.github.com/users/OrtOfOn/repos","events_url":"https://api.github.com/users/OrtOfOn/events{/privacy}","received_events_url":"https://api.github.com/users/OrtOfOn/received_events","type":"User","site_admin":false},"labels":[{"id":58674,"url":"https://api.github.com/repos/mrdoob/three.js/labels/Bug","name":"Bug","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mrdoob/three.js/milestones/5","html_url":"https://github.com/mrdoob/three.js/milestone/5","labels_url":"https://api.github.com/repos/mrdoob/three.js/milestones/5/labels","id":3117974,"number":5,"title":"r92","description":"","creator":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":0,"state":"open","created_at":"2018-02-14T21:57:07Z","updated_at":"2018-03-03T05:22:21Z","due_on":"2018-04-01T07:00:00Z","closed_at":null},"comments":69,"created_at":"2018-02-09T18:21:30Z","updated_at":"2018-03-03T09:16:06Z","closed_at":null,"author_association":"NONE","body":"I think I found a bug about your SkinnedMesh (tested on iPhone 6 & 8).\r\n\r\nIf this is already reported, I'm sorry, I didn't find it in the issue list :(\r\n\r\nIt seems the gpu skinning is not working correctly and getting crazy on mobile.\r\nWhen a SkinnedMesh is moving or moved at high value positions (ex: x:0, y:0, z:1000), the skinning is not accurate anymore and starts spider dance.\r\n\r\n**The scale of the mesh is affecting the bug. Bigger the scale is, lesser the bug.**\r\n\r\nIt seems the skeleton bones values are not calculated correctly at each frame and the bonesTexture/bonesMatrix on the skinning shader is pushing vertices at wrong place.\r\nThis is just my feeling of course.\r\n\r\nI ran many tests before posting this... looking for a clue in my animated exports but I found the bug is happening with any kind of formats (GLTF, FBX, Collada, JSON, ...) and models from ThreeJS repo.\r\n\r\nThat's very annoying because that means we are unable to develop a simple runner game with an avatar running (avatar.position.z increasing then) without having this issue :((\r\nI still don't know how I'll manage it as morphTargets is not an option :(\r\n\r\nHope you guys can help here.\r\n\r\nI made clear examples with clean source to expose the problem. It's quite easy to verify it on a smart phone:\r\n\r\nAppearing only on mobile (z=10000):\r\nhttp://cornflex.org/webgl/skinning-bug.html \r\n\r\nWith floatVertexTextures set to false (z=10000):\r\nhttp://cornflex.org/webgl/skinning-bug2.html\r\n\r\nGetting worse with distance (z increasing):\r\nhttp://cornflex.org/webgl/skinning-bug3.html\r\n\r\nVery very far from center (z=70000000) > bug also appearing on desktop \r\nhttp://cornflex.org/webgl/skinning-bug4.html\r\n\r\nVideo Preview in my game environment:\r\nThis is a realistic scale world (1.0m = 1.0 threejs unit).\r\nBug is appearing only after 50-60m and getting worse with distance:\r\nhttp://cornflex.org/webgl/skin-bug.mp4\r\n\r\n**VERY IMPORTANT** \r\nThe mesh used from the ThreeJS repo is way too big. It's like 20m tall.\r\nThat's why the z value has to be bigger to see the bug.\r\nIf this mesh is scaled down at realistic size, then the bug starts to appear even at 100m.\r\n\r\n\r\n##### Three.js version\r\n\r\n- [x] Dev\r\n- [x] r89\r\n- [x] ...\r\n\r\n##### Browser\r\n\r\n- [ ] All of them\r\n- [ ] Chrome\r\n- [ ] Firefox\r\n- [ ] Internet Explorer\r\n- [x] Safari\r\n\r\n##### OS\r\n\r\n- [ ] All of them\r\n- [ ] Windows\r\n- [ ] macOS\r\n- [ ] Linux\r\n- [ ] Android\r\n- [x] iOS\r\n\r\n##### Hardware Requirements (graphics card, VR Device, ...)\r\n\r\niPhone 6, 8\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/370133225","html_url":"https://github.com/mrdoob/three.js/issues/13288#issuecomment-370133225","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/13288","id":370133225,"user":{"login":"OrtOfOn","id":917547,"avatar_url":"https://avatars2.githubusercontent.com/u/917547?v=4","gravatar_id":"","url":"https://api.github.com/users/OrtOfOn","html_url":"https://github.com/OrtOfOn","followers_url":"https://api.github.com/users/OrtOfOn/followers","following_url":"https://api.github.com/users/OrtOfOn/following{/other_user}","gists_url":"https://api.github.com/users/OrtOfOn/gists{/gist_id}","starred_url":"https://api.github.com/users/OrtOfOn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrtOfOn/subscriptions","organizations_url":"https://api.github.com/users/OrtOfOn/orgs","repos_url":"https://api.github.com/users/OrtOfOn/repos","events_url":"https://api.github.com/users/OrtOfOn/events{/privacy}","received_events_url":"https://api.github.com/users/OrtOfOn/received_events","type":"User","site_admin":false},"created_at":"2018-03-03T09:16:06Z","updated_at":"2018-03-03T09:16:06Z","author_association":"NONE","body":"Hi Guys,\r\nFirst, thank your for getting back to this bug. I still didn't find the time to dig in it :(\r\n\r\n@daniel-nth The scale of the object is affecting the bug:\r\n\r\nOn iOS, with this very huge \"Lara\" object (height=120, scale=1), the bug appears at z=60000 indeed. But, if you take a realistic sized mesh (height=1.8, scale=1), it already appears only at z=100.\r\n\r\n> bigger the skinnedmesh, further the translation must be to see the bug.\r\n\r\nAs already tested and reported in this thread, disabling floatTextures on iOS results with no skinning at all.\r\n\r\nI also suspect a bad matrix multiplication or bar order of multiplication of the bones matrix.\r\n\r\n"}}
{"actor":{"display_login":"OrtOfOn"}}