playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.63k stars 1.34k forks source link

The WeChat applet IOS terminal accesses the playcanvas, and the display is abnormal #4875

Closed wei292224644 closed 1 year ago

wei292224644 commented 1 year ago

When using playcanvas as the webgl rendering engine of the WeChat applet, the effects of lighting and skybox can be displayed normally in the emulator. However, when debugging with a real device, the lighting and skybox cannot be displayed normally. Model is black.

39c928ce5146482faca4eb23b47291a

playcanvas version :1.58.1 wechat version: 8.0.29 phone: iphone 12 pro phone version : ios16

demo path:https://github.com/wei292224644/playcanvas-wechat-simple

slimbuck commented 1 year ago

Hi @wei292224644,

Thanks!

wei292224644 commented 1 year ago
  1. You need to register a WeChat account and use this account to log in to the IDE.(https://developers.weixin.qq.com/miniprogram/en/dev/devtools/page.html#Startup-Page)
  2. clone https://github.com/wei292224644/playcanvas-wechat-simple
  3. IDE import project (may need to click "test number")
  4. Open the WeChat software in the mobile phone
  5. Click the real device debugging button to test in the mobile phone (video 0:00:38)

https://user-images.githubusercontent.com/16398073/203519572-1f887d1d-9e15-4bd5-87fe-70858331ed95.mp4

mvaligursky commented 1 year ago

This could be related to using a cubemap faces for skydome. When the project starts, a cubemap is created from these, and then internally in the engine, the cubemap is converted to image based lighting probe in the envAtlas format. The problem we currently have is that when a device is lost, the engine does not re-generate this IBL probe and it stays black.

If this is the case, then @slimbuck plans to work on a new workflow, that is available in the engine already, but needs to be exposed in the Editor. Instead of using cubemap, the IBL in png format is created offline, and used directly. As this does not involve any render targets, it does not have any problem with lost device.

This is easy to test / use with the engine only example. In the Editor, this can be done by using a script, instead of specifying cubemap in the settings as skydome:

mvaligursky commented 1 year ago

I'm closing this. Please reopen if this does not solve your issue.