WebGL pause Rendering for less power consumption

Hi
I’m making a WebGL application that only needs to refresh on input. There is no movement without trigger.
So I thought I don’t need to render every frame, only when I get input. While I found several methods that do work in the editor, using them in WebGl always shows the BG color of the application.

  1. Disabling the main camera, ofc. doesn’t work, but I had to try.

  2. setting the cullingmask to nothing (for cheap rendering) and clearflags to nothing (so last frame would stay)

  3. wait for post render to change those settings, same result.

  4. Unfortunately changing the targetFrameRate also changes the Update speed, so if drag (to move the camera) it takes up to a secon to respond properly.

  5. works well in the eidtor, but not in webgl. In fact when I use the clearflags.nothing, a simple spinning cube becomes black except for the edges, but doesn’t leave a trail.

Now Unity pauses it’s webgl if the window is inactive, meaning I clicked away from the browser. Isn’t there a way to do exactly that?

What if disable all renderers and set timescale to 0 or close to 0, but input trigger move to html code and then call some method in unity which contains your workflow and Camera.Render(). It’s just in my theory.

A couple ideas-
Copy the screen pixels to a Texture2D and show that from a RawImage in a canvas. Now disable the main camera and it will only be rendering your static image. You might get a stutter when it copies the pixels though.

Render your scene to a RenderTexture which is shown on top of everything(again via the UI system). When you want to stop rendering, turn off the camera. The camera will not be rendering, but the RenderTexture should still display the last frame rendered to it.