-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Materials: Consider to use mediump for all shaders #14570
Comments
It's not checkable on desktop because even putting mediump on desktop uses highp. Of course maybe it's better than black. One solution is to use highp if it's supported, something like
or other contortions so at least you don't get black? |
In the issue that @Mugen87 referenced, the devices supported highp but it had glsl bugs when using highp that the conformance test didn't cover. |
If three defaults to mediump you'll basically get incorrect rendering on all phones because at the moment all phones (99%) will actually use mediump if you ask for it. At mediump the lighting will be wrong. If it's just one bad phone then I'd suggest you ask the WebGL people to add a test and then blacklist that phone until they fix it (or get them to make that phone not report it can support highp). |
I can confirm what @Mugen87 said about using |
It seems that current three.js check for device graphic capabilities gives false positive value on some hardware, which leads to this material rendering black issue. New discovery was, that in that vasturiano/globe.gl#44 site mentioned above, some coloured objects had solid colour, but the textured night globe was pitch black. This might be due to some specific material definition that allow some colours to render still even when this bug prevents some other materials to render correctly. I think that the only way to prevent this kind of bug to occur would be some kind of simple pre-check, where known colour object would be drawn on specific location (like the white cube) and then checked if the result on that pixel area is coloured black which would lead the default precision to be changed to mediump. How it is done codingwise, is up to someone who knows better. |
I don't think the engine should implement such checks. If a device says it supports The idea of this issue is to investigate whether it is possible to add |
Knowing closely how eager all mobile device manufacturers are to implement this kind of fixes on any older mobile devices, I would still try to ensure that three.js displays all content properly despite the mobile device hw/sw developers. If we would live in a perfect world, these kind of things would always be fixed. As long as the manufacturer's main business driver is to force users constantly buy new devices (designed obsolescense), any kind of fixes on older hardware drivers is practically none, especially in mobile devices. In order to guarantee functionality on as many devices as possible by default, no matter how badly others have done their homework, it would be strongly recommended that framework would probe in this case what is really possible and what's not. |
I think the option to set Unfortunately I am not experienced enough to do that, but I hope someone who knows the area better finds this thread and gives it a go. I am more than willing to do the tests when needed with actual mobile hw. |
Just found out that Adreno 330 has this same render black issue using |
I'm thinking this is something that is not that relevant/needed nowadays... |
Yeah, I think the amount of devices which only supports However, there is the valid use case that applications request |
That sound good 👍 |
Related: #8353 |
I have a device with this issue and would love a fix for this. Adreno Chrome <-- hehe. |
I don't think we'll end up doing this... |
Agreed. I think at this point we can close the issue and hope that devices catch up. |
Description of the problem
Right now, the default precision for shader progams in
three.js
ishighp
. Issues like #14137 showed that this approach causes rendering problems especially on (older) mobile devices . Usingmediump
would solve these issues and also improve the performance of the shader execution on mobile, see #14137 (comment).The problem is that certain materials like
MeshStandardMaterial
can not produce correct visual output withmediump
right now, see #14137 (comment). Changing certain parts of the shader souce code is necessary to solve this issue.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: