기억저장고

unity WebGL 빌드 후, Mac에서만 느릴경우 해결 본문

Unity

unity WebGL 빌드 후, Mac에서만 느릴경우 해결

기억해조 2023. 10. 26. 12:41

Html파일에서 추가하기

window.devicePixelRatio = 1;

 

 

위치)

    var script = document.createElement("script");
    var myGameInstance = null;
    script.src = loaderUrl;
    script.onload = () => {
      createUnityInstance(canvas, config, (progress) => {
        progressBarFull.style.width = 100 * progress + "%";
      }).then((unityInstance) => {
        window.devicePixelRatio = 1;//이것!...
        myGameInstance = unityInstance;
        loadingBar.style.display = "none";
        
      }).catch((message) => {
        alert(message);
      });
    };

 

 

출처

https://stackoverflow.com/questions/63749024/unity-webgl-performance-issues-on-retina-macbook

 

Unity WebGL performance issues on Retina (MacBook)

I developed a WebGL Unity 3D app with a 3d character that can navigate in the environment (mouse navigation and WASD) and interact with some objects. On windows it is all great and the FPS is 45-6...

stackoverflow.com

https://forum.unity.com/threads/webgl-retina-scaling.853144/

 

WebGL Retina Scaling

Hi, I know there were some changes introduced into 2019.3 which changed the way that scaling is handled in WebGL. There is a bit mentioned in the...

forum.unity.com

 

Comments