-
Notifications
You must be signed in to change notification settings - Fork 44
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
'highp' : precision is not supported in fragment shader #9
Comments
Could you please specify where in the code you did these changes? |
I've replaced Uint32Array with Uint16Array in two places where geometry index buffers are created: |
And for shaders, where ever I found "gl_FragColor". There were 5 of them in js file so I guess its these: Game was crashing on this one specifically, its probably the first one to be used: |
I may have fixed the issues with Uint32Array and "highp". Please get latest from develop branch, build it, and let me know if it works better for you. Something to have in mind though: If the model contains very many triangles (with indices) you will still get some error from PIXI if the device doesn't support uint32 (can't do anything about that - in that case the user of PIXI3D have to use simpler models). About highp/mediump, if the device doesn't support highp it may not render correctly (depending on the setup of the material and lighting). |
Tested on two devices with a problem - Samsung J2 and Infinix Hot 5 Lite, works fine on both. |
This is error from an old android 7.0 device (Infinix Hot 5 Lite). I solved this issue by setting 'mediump' precision for fragment shaders - you should probably use PIXI.settings.PRECISION_FRAGMENT value (its 'mediump' by default but I think they determine its value at runtime ??). Pixi also has PRECISION_VERTEX (https://pixijs.download/dev/docs/PIXI.settings.html#PRECISION_VERTEX).
Then another problem happened as 3D models were not visible with this warning in console:
unsupported index buffer type: uint32
Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly
This was also solved by using Uint16Array (in only 2 places, I've done both of these changes in generated js file).
So check for Uint32Array support would be good too.
The text was updated successfully, but these errors were encountered: