[React Native] EngineView occasionally not rendering on load

Dependencies:

  • Babylon: 5.13.2
  • ReactNative: react-native-iosandroid-0-65
  • iOS: Reproduced on iOS 15 and 16.

Repro steps:

  1. Clone this sample code: GitHub - BabylonJS/BabylonReactNativeSample
  2. Run it on an iOS simulator or real iOS device.
  3. Using metro, press R in the terminal (or shake the device > reload) to reload several times in a row until the EngineView shows up completely white (see attached video below).

Note: It took me several tries to reproduce, however, when using it at scale (many users), it does reproduce enough times to be a problem
Running a GPU frame capture shows that the rendering is allegedly fine (Xcode will show the proper render pass running, however the EngineView will still be white).

RPReplay_Final1663131332.mov.zip (2.9 MB)

pinging @srzerbetto

@Cedric wondering if it could be related to the latest life cycle changes ???

@clem , can you share the version of react-native-iosandroid-0-65 you are using? Is it the default that cames with BabylonJS/BabylonReactNativeSample?

1 Like

This issue should be fixed with Fix fast refresh for PG by CedricGuillemet · Pull Request #454 · BabylonJS/BabylonReactNative · GitHub
Can you try to repro with this branch?

2 Likes

@srzerbetto that’s right, it’s the one coming with the sample code (unchanged).

Hi @clem just checking in if Cedric’s fix worked for you?

Just FYI, I can confirm that it’s not fixed with this PR#454 merged in @babylonjs/react-native@1.4.2

Thanks for the report! Is the problem reproduced with the same steps as the first post? ccing @BabylonNative for attention

@Cedric , for visibility. It might take time for him to visualize due to the holydays.

1 Like

I’ve open an issue to keep track:

I’m not sure it’s related to lifecycle as previous bugs. If the rendering is done but not visibile, it might be related to Metal. Need testing of Android to see if the same issue appears as well.

3 Likes