Integrate react-native-skia in a ECS / Gameloop #3224
Replies: 2 comments 3 replies
-
Hey, were you able to find an answer for that? |
Beta Was this translation helpful? Give feedback.
-
I was building a very similar worklet based ecs system but for rendering target I've chose normal non skia react-native views. update: For my tests I'm using Sony Xperia 10 IV with Snapdragon 695 which is considered rather budget CPU. From my observations declarative SKIA target has more stable FPS than react-native+reanimated, but it doesn't really matter as both rendering pipelines have exactly the same bottleneck which is spawning/despawning views on screen. Declarative SKIA have much more stable FPS during simultaneous animation, but the process of spawning views above 128 elements on screen can drop FPS to 8 frame rates. It stabilises later, but such frame drops are unacceptable and makes such rendering target useless for any game that operates on many quickly spawned/despawn entities. On another hand, I have implemented a rendering pipeline that targets skia's imperative API. TLDR; ensure your ECS system is working on worklets and use skia's imperative API, this should give you quite good results. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm in the process of building a simple (multiplayer) game. (Agar.io optics) I came across the following problem:
I have many game objects that are added and removed - so a dynamic list of a large number of objects that are on the screen at the same time.
My game logic runs in a game loop at a fixed rate because the logic has to run later on the client and on the server.
Now my question: How (via which api) can I best bring all my game objects and my hud data efficiently to the skia canvas in my RenderSystem - i.e. preferably without setState from React, but on the ui thread?
The Picture, Atlas and offscreen rendering all don't seem to be 100% the right approach, or am I looking at it wrong?
I have react-native-reanimated installed already.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions