gulio Posted February 23, 2024 Share Posted February 23, 2024 (edited) Hi there, I'm working on creating a casino slot game which has a lot of reels. The reels themselves are very heavy so I'm using a renderTexture for each reel to optimize. It helps a lot, but up to a point - when the renderTextures are more than 25ish fps goes from ~55 to ~25. I've only seen discussions that include culling as a method for optimizing but thats not an option for me as all renderTextures are visible at all times, so there's nothing to cull. The textures themselves are not too small, but it's the smallest they can be - exactly the size of the thing they are rendering. Issues occur on an Iphone13 so I can't imagine what would happen on a lower-end device. Here's how I'm using it: The reel is passed as a source and a renderTexture is created from it, the reel itself is then not rendered anymore. const createRt = (source, width = source.width, height = source.height) => { const texture = RenderTexture.create({ width, height }); if (RENDERER.mask) { RENDERER.mask.enableScissor = true; } const updater = () => RENDERER.render(source, { renderTexture: texture }); CombinedTicker.Ticker.add(updater); const sprite = new Sprite(texture); return sprite; }; Edited February 23, 2024 by gulio Quote Link to comment Share on other sites More sharing options...
gulio Posted March 7, 2024 Author Share Posted March 7, 2024 SOLUTION: Checking if the source is visible when attaching the ticker updater got the fps up by ~20. const createRt = (source, width = source.width, height = source.height) => { const texture = RenderTexture.create({ width, height }); if (RENDERER.mask) { RENDERER.mask.enableScissor = true; } const updater = () => source.visible && RENDERER.render(source, { renderTexture: texture }); CombinedTicker.Ticker.add(updater); const sprite = new Sprite(texture); return sprite; }; Quote Link to comment Share on other sites More sharing options...
neelyang77 Posted March 18 Share Posted March 18 On 3/7/2024 at 8:54 AM, gulio said: SOLUTION: Checking if the source is visible when attaching the ticker updater got the fps up by ~20. Keeping up with the iGaming industry https://15m.com/news/ requires constant monitoring of laws, regulations, and market dynamics. This news outlet delivers comprehensive coverage of global regulatory changes, licensing updates, and emerging trends impacting online gaming operators. It also examines innovations in gaming platforms, technology, and player experience, providing context for strategic business decisions. By offering in-depth analyses of market movements and regulatory developments, it helps stakeholders navigate complex international environments. Whether you are involved in operations, investments, or research, staying informed through this news ensures you understand the evolving challenges and opportunities shaping the iGaming landscape. const createRt = (source, width = source.width, height = source.height) => { const texture = RenderTexture.create({ width, height }); if (RENDERER.mask) { RENDERER.mask.enableScissor = true; } const updater = () => source.visible && RENDERER.render(source, { renderTexture: texture }); CombinedTicker.Ticker.add(updater); const sprite = new Sprite(texture); return sprite; }; Thanks a lot for this update, I was searching for it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.