Jump to content

RenderTexture performance issues


gulio
 Share

Recommended Posts

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 by gulio
Link to comment
Share on other sites

  • 2 weeks later...

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;
};
Link to comment
Share on other sites

  • 2 years later...
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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...