three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Incorrect texture output on a SkinnedMesh

Open dimanux opened this issue 11 years ago • 9 comments

Hi, I have results from QA team for the game (Three.js v70): http://gemioli.com/thesaloon/html5/gemioli/

They sent me a couple of game screenshots with a texture bug:

screenshot_2015-01-29-14-52-51 screenshot_2015-01-29-14-53-58

Characters are SkinnedMeshes with MeshBasicMaterial (one map, skinning is true). Windows are SkinnedMeshes too, but they have correct visualization of texture.

It appears only on devices:

  • S4 (Android 4.4.2, Chrome 40.0)
  • Nexus 5 (Android 4.4.4, Chrome 40.0)
  • Xperia A (Android 4.2.2, Chrome 40.0)
  • Xperia Z (Android 4.1.2, Chrome 40.0)
  • Sharp Mini (Android 4.2.2, Chrome 40.0)

On all other mobile devices the game seems to be working great. I have not these devices right now. So any help or suggestion how to fix it will be appreciated. Thanks

dimanux avatar Feb 26 '15 14:02 dimanux

Hm, It seems like a BoneTexture sometimes replace a Map texture. I made an output of a BoneTexture to a Map channel: screen

But I have no idea why it is happen on some devices :(

dimanux avatar Feb 27 '15 09:02 dimanux

I have a Nexus 5, if you send me the source files I can take a look.

mrdoob avatar Feb 27 '15 11:02 mrdoob

Thanks, I have sent you an email.

dimanux avatar Feb 27 '15 21:02 dimanux

Can you try with this build?

https://github.com/mrdoob/three.js/raw/dev/build/three.min.js

We found some texture handling bugs. Maybe that helps...

mrdoob avatar Mar 28 '15 01:03 mrdoob

Unfortunately I haven't any device from the list above at the moment. But I have uploaded a debug version with 72dev here: http://www.gemioli.com/thesaloon/debug/debug.html

Please could you test it on your Nexus 5? I will send a message to QA team as soon as possible.

Also QA have added the Moto X phone to the list above :(

I have seen commits. And I have to mention that we pre-upload textures while game loading at TextureLoader class:

        GEMIOLI.ImageLoader.load(url, function(image) {
            texture.image = image;
            texture.generateMipmaps = false;
            texture.magFilter = THREE.LinearFilter;
            texture.minFilter = THREE.LinearFilter;
            texture.needsUpdate = true;
            that.loading.remove(url);
            that.loaded.add(url, texture);
            GEMIOLI.Renderer.uploadTexture(texture, 0); // Pre-upload
            texture.dispatchEvent({type: 'load'});
        }, function(event) {
            that.loading.remove(url);
            texture.dispatchEvent(event);
        });

It's guaranteed that image catches the 'load' event before entering to uploadTexture function. But we don't check the 'complete' property of an input image.

dimanux avatar Mar 28 '15 12:03 dimanux

Hmmm, I can't reproduce the issue on my Nexus 5 with the link in the first post anymore...?

mrdoob avatar Mar 28 '15 21:03 mrdoob

Thanks. We haven't changed it since it was posted here :( Maybe firmware/browser update fixed the issue?

And what about last link? Does it have the issue?

dimanux avatar Mar 29 '15 10:03 dimanux

None of them have the issue. Nice game by the way!

mrdoob avatar Mar 29 '15 13:03 mrdoob

@mrdoob Thanks!

So I have no idea how to fix the issue without real device with it. As a temporary fix to pass QA tests of some portals we disable bone textures on Android devices at the moment...

Here is a screenshot from the Moto X phone of a latest no-ads version of the game: screenshot_2015-03-23-10-41-11

dimanux avatar Mar 29 '15 14:03 dimanux