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

MeshPhongMaterial is rendered black on Huaweï MediaPad T3 #12679

Closed
5 tasks done
Alexandre-Passerelle opened this issue Nov 16, 2017 · 29 comments
Closed
5 tasks done

MeshPhongMaterial is rendered black on Huaweï MediaPad T3 #12679

Alexandre-Passerelle opened this issue Nov 16, 2017 · 29 comments

Comments

@Alexandre-Passerelle
Copy link

Alexandre-Passerelle commented Nov 16, 2017

Device

This occur on Huaweï MediaPad T3 10 (AGS-L09) - Androïd 7 / EMUI 5.1 / Snapdragon 425 / 2Go RAM / 800x1280

Note that this issue DO NOT occur on these other devices tested on my own :

  • Huaweï P8 Lite (Android 6 + EMUI 5.1)
  • Huaweï P9
  • HTC Nexus 9 (Android 7.1.1)
  • Galaxy Tab A 2016 ( Android 7)
Description of the problem

Mesh with MeshPhongMaterial is rendered black, the sample of official documentation is concerned too.
screenshot_20171116-190002
All my test with MeshPhongMaterial do the same, whatever light used...
No problem with MeshLambertMaterial (but can't use it since it don't accept bumpMap

As an old code of mine worked, I've done many test that revealed this issue happen since version 74 of Three.js. Version 73 worked (as 72 and 71)

Warnings on Chrome console :
  • three.min.js:145 : THREE.WebGLRenderer: WEBGL_depth_texture extension not supported.
  • three.min.js:145 : THREE.WebGLRenderer: OES_texture_float_linear extension not supported.
  • three.min.js:93 : THREE.WebGLProgram: gl.getProgramInfoLog() --From Vertex Shader:
    --From Fragment Shader:
    Link was successful.

Three.js version
  • r73 to r86
Browser
  • Chrome
  • Cordova + XWalk
  • Firefox
OS
  • Android
WebGL report :

screenshot_20171116-192023

@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 16, 2017

As an old code of mine worked, I've done many test that revealed this issue happen since version 74 of Three.js. Version 73 worked (as 72 and 71)

see #12592 (comment)

It seems both issues are related in some way...

@mrdoob
Copy link
Owner

mrdoob commented Nov 17, 2017

@Alexandre-Passerelle
Copy link
Author

Alexandre-Passerelle commented Nov 17, 2017

Is it this one?

It's not the Huawei M3, mine is T3 10"

see #12592 (comment)
It seems both issues are related in some way...

I will check at work today, but from my memory, no problem with Lambert...

EDIT : OK with MeshLambertMaterial
screenshot_20171117-103200

@Alexandre-Passerelle Alexandre-Passerelle changed the title MeshPhongMaterial is rendered black on Huaweï MediaPad 3 MeshPhongMaterial is rendered black on Huaweï MediaPad T3 Nov 17, 2017
@makc
Copy link
Contributor

makc commented Nov 30, 2017

this issue happen since version 74 of Three.js. Version 73 worked

there is a lot of going on between two versions, actually. I thought doing quick diff between the shaders will highlight it, but no. still, if you want to save yourself some time, here are the files:

r73.txt
r74.txt

(saved from following fiddles: r73, r74)

@Alexandre-Passerelle
Copy link
Author

Indeed, the lot of differences make me crasy as i'm not familiar with shaders...
As my project is concerned, i will try to learn more about shader and blending in order to make a substitute of Phong one, because using an old version of Three is not the best solution...

The other problem is what tablets/phones are concerned by this issue...

(Please forgive my english)

@makc
Copy link
Contributor

makc commented Nov 30, 2017

to make a substitute of Phong one

Idk if it's possible to use 3js lights in custom shader, but you could always put your lights world positions and params in uniforms by hand

@mrdoob
Copy link
Owner

mrdoob commented Feb 7, 2018

Is this still an issue?

@Alexandre-Passerelle
Copy link
Author

I haven't test last revision since we give back Huawei tablets to our client.
I'm affraid to never know the cause (Huawei GPU ? Software ? ...)
We finished the project with r73 (without AA because of some bugs i don't really understood during scene resizing on this older version).
My WebGL knowledges are too poor for more investigation on shader side.
I don't really like this workarround but no other choice, we spend many time successless yet...

Thanks you for your comments.

@mrdoob mrdoob closed this as completed Feb 7, 2018
@EerikKivistik
Copy link

@mrdoob This still seems to be an issue and it also seems to be more widespread than it used to. We have recently started getting more and more reports from our users (3d editor on mobile devices), who are experiencing this issue. As far as I can tell, it affects all releases from r73-r91. I will see if I can compile a list of affected devices. I will also provide some sample screenshots and material parameters, that produce different results.

@mrdoob
Copy link
Owner

mrdoob commented Mar 24, 2018

A list of devices (and gpus) would indeed be super helpful!

@throni3git
Copy link
Contributor

Same issue on Samsung SM-T555 (Galaxy A). It does support OES_texture_float but not the filtering extension OES_texture_float_linear, whilst supporting OES_texture_half_float_linear and OES_texture_half_float.

Can textures be switched vom type=Float to HalfFloat eaysily?

@EerikKivistik
Copy link

EerikKivistik commented Mar 25, 2018

I'll add a list of devices that my users are having issues on. I have tried to reproduce on around 30 devices and am unable to find one with the issue. What I do know is that it started happening a lot more often when people upgraded from an older version of Android to Android 7.0. Some of our users are willing to help us debug, so if you have a specific fix you want to try out, I can forward it to our users.

I'll also note, that this example fails on all of the listed devices (scene completely black): https://threejs.org/examples/?q=lights#webgl_lights_pointlights2, screenshot included.
screenshot_2018-03-08-14-49-31-209_com android chrome

Affected devices that I am aware of:

  • Xiaomi Redmi 4A, Android 7.1.2, MIUI 9.2.6.0
  • Acer Predator 8 (GT-810 rolex), Android 7.1
  • LG K20 Plus (lv517), Android 7.0
  • Galaxy Tab A 9.7 (gt510wifi), Android 7.1
  • Moto G4 Play (harpia), Android 7.1
  • Galaxy Tab E 9.6 (gtelwifiue), Android 7.1
  • Galaxy J5(2016) (j5xnlte), Android 7.1
  • Galaxy Tab A 9.7 (gt510wifi), Android 7.1
  • HM NOTE 1LTETD (dior), Android 4.4

@EerikKivistik
Copy link

@mrdoob Is there anything else I can provide you with to help with debugging?

@mrdoob
Copy link
Owner

mrdoob commented Mar 30, 2018

@EerikKivistik Not for now. That list is great. I'll try to buy one of these. Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Apr 5, 2018

Okay, so I bought a Moto G4 Play (XT1609). It's still on Android 6.0.1.

screenshot_20180405-143600

screenshot_20180405-143816

Not sure how to update it to 7.1, but It's interesting to see that with 6.0.1 it works fine.

@EerikKivistik
Copy link

I was wondering that myself, why this issue started spreading with Android 7.0+. There is always the chance that the users are running something like CyanogenMod, that causes this. But that is just a shot in the dark. As far as I know, it can be upgraded to 7.0 via official channels, so shouldn't be too much fiddling.

@throni3git
Copy link
Contributor

For my Samsung SM-T555 (Galaxy A) with Android Version 7.1.1 and Samsung Experience version 8.5 it doesn't work. No user mod involved here.

@EerikKivistik
Copy link

Yeah, the issue seems to getting more prevalent, at this point I think we are getting a few hundred reports a week from our users. Any news on your end @mrdoob?
As a side note, I'm currently considering hot-switching all the materials out to Lambert during runtime as a dirty temporary workaround. In case someone is looking for a really awkward fix until this is solved.

@mrdoob
Copy link
Owner

mrdoob commented Apr 13, 2018

@EerikKivistik The Moto G4 Play (XT1609) I bought is not receiving the 7.1 update 🙁

@nilsmoh
Copy link

nilsmoh commented May 8, 2018

@mrdoob According to Wikipedia XT1609 is the Verizon Model of this Phone.
Recently exactly this version of the Moto G4 Play should have gotten Android 7.1.1
Please try again to update your device. :-)

https://en.wikipedia.org/wiki/Moto_G4
http://www.ubergizmo.com/2018/02/verizon-moto-g4-play-android-7-1-1-nougat/

@mrdoob
Copy link
Owner

mrdoob commented Jun 16, 2018

In #14137 it was discovered that changing precision to mediump solves the issue.

Could you guys try passing the precision to the material like this?

var material = new THREE.MeshPhongMaterial( { precision: 'mediump' } );
var material = new THREE.MeshStandardMaterial( { precision: 'mediump' } );

@EerikKivistik
Copy link

I tried with setting the renderer precision to mediump (not material) and it did start rendering in color, but it has some artifacts, I will post the image here as well from one of our users:
screenshot_2018-06-14-22-55-57-765_com android browser

Would you like me to try this with materials only?

@makc
Copy link
Contributor

makc commented Jun 18, 2018

@EerikKivistik btw, what's with the black border around "G" icon, is it normal?

@EerikKivistik
Copy link

@makc No clue, it's a screenshot sent to me by a user of our software.

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2018

I tried with setting the renderer precision to mediump (not material) and it did start rendering in color

How did you do that? 🤔

@EerikKivistik
Copy link

I think you answered that question yourself in another thread already :)

@Alexandre-Passerelle
Copy link
Author

Alexandre-Passerelle commented Jun 21, 2018

Thank you everyone !
The {precision: 'mediump'} has resolved our issue !

EDIT : I can't mark subject resolved...

@makc
Copy link
Contributor

makc commented Jun 21, 2018

with some phones that need medium precision to work nice, while some other phones need high precision, what are we, app-level devs, are supposed to do?

I guess someone needs to make an utility that, given user agent, would apply fixes to materials

glslFixer = new Whatever(userAgent);
glslFixer.fixThreeJSMaterial(material);

or maybe all materials (via THREE.ShaderLib or what was that place)

@mrdoob
Copy link
Owner

mrdoob commented Jun 25, 2018

with some phones that need medium precision to work nice, while some other phones need high precision, what are we, app-level devs, are supposed to do?

No idea... 😕 I think we are trying to move the shaders code to mediump...

I guess someone needs to make an utility that, given user agent, would apply fixes to materials

I don't think we can get the device info out of the user agent... 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants