jnsmalm / pixi3d

The 3D renderer for PixiJS. Seamless integration with 2D applications.
https://pixi3d.org
MIT License
759 stars 44 forks source link

Hi, sir. I have tested this library in some old android devices #21

Closed amin2312 closed 2 years ago

amin2312 commented 3 years ago

I found that if the device can't support WebGL2, it can't be displayed. Is it right? This library is only run in WebGL2?

jnsmalm commented 3 years ago

It supports both WebGL1 and WebGL2

jnsmalm commented 3 years ago

Does it output nothing or is the model rendered just black?, Which device are you using?

amin2312 commented 3 years ago

The model rendered just black. I use Redmi 5A and Galaxy Grand Prime, them only support WebGL1.

jnsmalm commented 3 years ago

Could you please test and turn off lighting and see if the colors are being rendered?

model.meshes[0].material.unlit = true

jnsmalm commented 3 years ago

Could you also please visit https://webglreport.com with that device and post the results if possible?

amin2312 commented 3 years ago

Could you please test and turn off lighting and see if the colors are being rendered?

model.meshes[0].material.unlit = true

Yes, use this option, the render is normal

amin2312 commented 3 years ago

Could you also please visit https://webglreport.com with that device and post the results if possible?

a2 a1 a3

jnsmalm commented 3 years ago

Thanks a lot, I'll try to make something out of this info.

jnsmalm commented 3 years ago

I tested on an old device "Samsung Galaxy Core Prime" which seems pretty similar to yours, it was release 2014. First I had issues, but after upgrading to latest Chrome all the examples looked correct.

Just to make sure, could please see if you have latest Chrome installed and try again?

amin2312 commented 3 years ago

Is this phone support WebGL2? If the device can't support WebGL2, it can't run it normally, even if use the new chrome versoin. I have tested 3 old phone(don't support WebGL2), all aren't normal.

jnsmalm commented 3 years ago

Yes it does support WebGL 2, but that is not why it works. I can force PixiJS to use WebGL 1 by doing PIXI.settings.PREFER_ENV = PIXI.ENV.WEBGL and it still works on my Galaxy Core Prime.

I also know that the library works on WebGL 1, because everything is correct on iPhone/Safari (and no iPhone supports WebGL 2). It just has to be something else, which I'm trying to figure out. Which is the third device you have tested this on? (I already know you have Galaxy Grand Prime and Redmi 5A). I would need one of those phone for testing, but it seems they are hard to get.

jnsmalm commented 3 years ago

Does the lighting example https://github.com/jnsmalm/pixi3d/blob/develop/examples/src/lighting.js work on any of your Android devices?

kasiaustas commented 3 years ago

Hello! I faced a similar problem. My 3D-model does not displayed on ios10-13 at all, but on ios14 and android 7- 11 it works correctly. How can this be fixed?

jnsmalm commented 3 years ago

Hello! I faced a similar problem. My 3D-model does not displayed on ios10-13 at all, but on ios14 and android 7- 11 it works correctly. How can this be fixed?

Hi!

I don't have a iOS device < 14 so I can't test for myself.

kasiaustas commented 3 years ago

Hello! I faced a similar problem. My 3D-model does not displayed on ios10-13 at all, but on ios14 and android 7- 11 it works correctly. How can this be fixed?

Hi!

  • Is the model rendered black or is it not displayed at all?
  • If you connect your device to a desktop machine and debug it, do you get any errors or warnings in console?
  • Does any of the examples (included in repo) work correctly?
  • Have you tried turning off lighting calculations? model.meshes.forEach(mesh => mesh.material.unlit = true)

I don't have a iOS device < 14 so I can't test for myself.

Hello! Thank you! The model did not displayed at all. The problem connected with function Uint8Array.from(), using Babel's polyfill package didn't help for me. I rewrote the function to 'new Uint8Array()' and it is working good now.

jnsmalm commented 3 years ago

@kasiaustas Good to know! Did you change it in src/gltf/gltf-asset.ts file only? So I can apply this update, or maybe you can submit a PR?

bigidea-kz commented 3 years ago

@kasiaustas Good to know! Did you change it in src/gltf/gltf-asset.ts file only? So I can apply this update, or maybe you can submit a PR?

Perhaps this is related to this PIXI3D.ShadowCastingLight.isMediumQualitySupported(app.renderer)

jnsmalm commented 3 years ago

@kasiaustas Good to know! Did you change it in src/gltf/gltf-asset.ts file only? So I can apply this update, or maybe you can submit a PR?

Perhaps this is related to this PIXI3D.ShadowCastingLight.isMediumQualitySupported(app.renderer)

I guess he is referring to https://github.com/jnsmalm/pixi3d/blob/develop/src/gltf/gltf-asset.ts#L126, it's the only place in code where Uint8Array.from() is used.

jnsmalm commented 2 years ago

As this library is now being used in production in different projects with hundres of thousand of users I have not received any indication this is a real problem. Users seem to simply not use these devices which have these issues or the number of users with those devices is so small that it's simply not worth the effort fixing this. If anyone can provide me devices which have these issues (so I can debug this), let me know.