Search Unity

Question How to reduce the drawing load on mobile WebGL

Discussion in 'Web' started by M-SugayaTakuma, Mar 16, 2023.

  1. M-SugayaTakuma

    M-SugayaTakuma

    Joined:
    Apr 9, 2020
    Posts:
    12
    Hello.

    I am developing WebGL on mobile and want to reduce the rendering load on the device.
    In my opinion, one way to do this is to reduce the screen resolution, even at the expense of quality in particularly.

    I have tried changing the size of the Canvas first, but it did not change the rendering load on mobile.
    We also tried using Screen.SetResolution, but this setting was not affected.

    Even if the size of the canvas is set to a smaller size on a high-resolution device, the device itself tries to draw the image at its own resolution, so the processing is still very high-load, and there is a great loss of performance.

    Next, we set config.devicePixelRatio in index.html even smaller than the original 1.
    This is an item that can only be set when the Unity game is launched, and I suspect that it cannot be changed dynamically (e.g., while the user is selecting quality) during game launch.

    In mobile WebGL, is it possible to dynamically change the devicePixelRatio or reduce the resolution when drawing in other ways?

    Thank you.

    Translated with DeepL