phetsims / scenery

Scenery is an HTML5 scene graph.
http://scenerystack.org/
MIT License
55 stars 12 forks source link

WebGL is broken on iPad #1649

Open pixelzoom opened 4 months ago

pixelzoom commented 4 months ago

Using WebGL on iPad results in the sim crashing. The past 2 sims that I've worked on have both had this problem, where WebGL was enabled to take advantage of Sprites performance. See:

The workaround in both cases has been to disable WebGL on mobile Safari. For example, in FELSim.ts:

      // WebGL is typically enabled for high-performance scenery.Sprites, which are used heavily by this sim.
      // On iPadOS, the sim consistently crashed when WebGL was enabled, and we were unable to determine why.
      // Disabling WebGL uses Canvas as the fallback for Sprites. The problem was not present on iOS, but we
      // have no way to differentiate between Safari on iPadOS vs iOS, so WebGL is disabled on both platforms.
      // See https://github.com/phetsims/faradays-electromagnetic-lab/issues/182.
      webgl: !platform.mobileSafari,

This seems like a problem that should be investigated and resolved with high priority, instead of continuing to disable WebGL on iPad.

jonathanolson commented 4 months ago

Noted in Slack I'd need to have an iPad to debug this. @kathy-phet or @KatieWoe let me know if there's a good way for me to get a hold of one.

jonathanolson commented 3 months ago

https://stackoverflow.com/questions/76127296/debugging-a-ios-safari-crash-a-problem-repeatedly-occurred mentions potential GPU memory.

zepumph commented 2 months ago

@jonathanolson have you been working on this recently? If so can you give an update here? @samreid and I have continued in https://github.com/phetsims/density-buoyancy-common/issues/316 and it would be good to understand if you are also in the area.