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

Phong and Standard materials are broken @ Adreno 308 Phones #19351

Closed
0b5vr opened this issue May 13, 2020 · 13 comments
Closed

Phong and Standard materials are broken @ Adreno 308 Phones #19351

0b5vr opened this issue May 13, 2020 · 13 comments

Comments

@0b5vr
Copy link
Collaborator

0b5vr commented May 13, 2020

Description of the problem

The examples for phong and standard materials are broken on Adreno 308 phones.
I'm gonna try other GPUs as well. did it, results below

Android%20One%20S2_20200513_192627

Three.js version

r116

Environments
  • Adreno 308

    • Android One S2, Android 8.0.0, Chrome 81
    • it LGV36, Android 8.1.0, Chrome 81
    • Galaxy J4+ SM-J415N, Android 8.1.1, Chrome 81
  • DID NOT repro @ Adreno 306

    • Galaxy J5(2016) SM-J510S, Android 6.0.1, Chrome 81
  • DID NOT repro @ Adreno 430

    • Xperia Z5 SO-01H, Android 7.0, Chrome 81
@0b5vr
Copy link
Collaborator Author

0b5vr commented May 13, 2020

It seems that the reproducing range is extremely small, we might just want to ignore this......
I'm tweaking around shaders right now but I completely have no idea what is wrong with the issue

@mrdoob
Copy link
Owner

mrdoob commented May 13, 2020

Was this the issue that required material.precision = 'mediump';?

@0b5vr
Copy link
Collaborator Author

0b5vr commented May 14, 2020

Wow... you're right. material.precision = 'mediump' makes it work...

Honestly I'm not sure what should we do from here...

@Mugen87
Copy link
Collaborator

Mugen87 commented May 14, 2020

see #14137 (comment)

It means that the highp codepath on certain Adreno devices is buggy and the following WebGL conformance test should fail:

https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/struct-as-inout-parameter.html?webglVersion=1&quiet=0&quick=1

It's a Qualcomm driver bug which is unlikely to be fixed.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 14, 2020

Also related: #14570

@Mugen87
Copy link
Collaborator

Mugen87 commented May 14, 2020

Marking this issue as a duplicate of #14137.

@Mugen87 Mugen87 closed this as completed May 14, 2020
@mrdoob
Copy link
Owner

mrdoob commented May 14, 2020

@fms-cat

Honestly I'm not sure what should we do from here...

@bhouston proposed that we should try to use mediump by default in the library and fix any shaders that require changes.

@0b5vr
Copy link
Collaborator Author

0b5vr commented May 18, 2020

I'm going to switch to mediump by the application side when the GPU is Adreno 308 for this time. Thanks for the info!

@arpu
Copy link

arpu commented May 18, 2020

@fms-cat can you share the code to change this on Application level?

@0b5vr
Copy link
Collaborator Author

0b5vr commented May 19, 2020

@fms-cat can you share the code to change this on Application level?

Using material.precision for each materials as noted above worked for me.

@arpu
Copy link

arpu commented May 19, 2020

thx! if i set https://threejs.org/docs/#api/en/renderers/WebGLRenderer.precision does this set it for the material too? ( like for all materials i use like in glb models)

@Mugen87
Copy link
Collaborator

Mugen87 commented May 19, 2020

@arpu Yes, this is the default for all materials. You can overwrite it by setting precision on material level.

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

5 participants
@arpu @mrdoob @0b5vr @Mugen87 and others