better-unity-webgl-template icon indicating copy to clipboard operation
better-unity-webgl-template copied to clipboard

Work great on PC (fullHD) but it look pixelated in the mobile browser (fullHD+)

Open nminhhoangit opened this issue 3 years ago • 3 comments

Your template work great on browser in pc. But when I open from mobile browser with fulldHD+ resolution it look very pixelated. This not happened on unity editor or build to android apk but only in webgl on mobile browser only.

Please help me to solve this. Thanks!

nminhhoangit avatar Aug 25 '21 10:08 nminhhoangit

You can try deleting this line in Assets/WebGLTemplates/Better2020/index.html

https://github.com/greggman/better-unity-webgl-template/blob/ba9152705c2f4a58ab5ab58f86f8d3f61fd079ed/Assets/WebGLTemplates/Better2020/index.html#L70

Be aware that higher-res = lower performance

You might also consider something like

 config.devicePixelRatio = Math.min(config.devicePixelRatio, 2);  // or 3 etc. 

Some phones are as high as 4 I believe which is up to 16x slower than 1

greggman avatar Aug 26 '21 23:08 greggman

hey @greggman! Just curious - do you intend to persist that change? Because I just faced the same issue and your solution helped.

Enigo avatar Feb 23 '22 07:02 Enigo

@Enigo, At the moment I don't intend to persist that change. You should just edit your local copy to do what's right for your app. There's no "one size fits all" solution here.

greggman avatar Feb 23 '22 09:02 greggman