Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to reduce the drawing load on mobile WebGL

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

  1. M-SugayaTakuma


    Apr 9, 2020

    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