Stop rending world layer when showing UI

Simply said, I have world layer and ui layer. What I want to do is to “freeze” the world rending, make it just an image that will take 1 draw call. Why I need it: both world and ui are full of content and require a lot of draw calls to render. UI background is half transparent so the world is visible. Optimisation. I saw autoRender option, but it stops the whole rending. Is there any “easy” option to do what I want, or would it require more intense manipulations like canvas renderTarget and so on.?

Hi @Dmytro_Khudiiash!

Maybe you can use the code below for this. = 0;

I use it to pause a game.

I believe you didn’t get my point. timeScale 0 will freeze the whole app. I need to stop rending a specific layer. While world is a still image, the UI layer is functional and responsive. Also, changing timeScale does not help to reduce draw calls, which is the foremost purpose of the whole idea.

The problem is that the world itself requires ~50 draw calls, and the UI ~60-70 draw calls. When they both are rendered, its a lot of draw calls, and some phones get melting. I want to stop wasting 50 draw calls when the the world is paused. However, as I have said, the world still needs to be there, as the UI does not cover the whole screen.

I’m sorry to hear you are not happy with my suggestion.

It was just an idea that popped into my head, because I thought it does a lot of what you ask. The world is still visible and the user interface is still clickable by the user. I think you’ll at least safe performance once the world stops updating in the background.

You may be able to take a screenshot and present it in the background, but I’m afraid this requires a lot more work. I hope someone has a better suggestion, so I can learn from it as well.

1 Like

It’s not that I am not happy with your suggestion. It just does not hit my goal. But I believe you are right. Achieving this type of thing would require a lot of work, mainly creating a new canvas, render the world to it, and use it as a texture for the screenshot. I hoped the engine might have some feature to do that kind of thing without that much effort.

1 Like