[4.7] HTML5 resolution


Is there any way to change the default screen resolution of a html5 exported project ? I have tried to change the resolution in the Html5Engine.ini file in the engine folder, but that didn’t seem to work.

also interested in this

I have also found no solutuion for it yet…The r.SetRes command do not work. It would be very useful when this feature will be integrated in the the next updates of the Unreal Engine 4.

Any Epic input on this question? I’ve had no luck changing it from the default 800x600 either. Have tried in HTML5.ini, and in device profiles in the editor, but they seem to be ignored. Changing it in-game (console or blueprint) does change the resolution, but it doesn’t scale to the canvas (you can only see part of the rendered screen).

Is this currently hard-coded?

It is really disappointing that EPIC gives us no help. I have still huge problems with the HTML5 resolution. I have no idea where I can change it.

HTML5 provides no Antialiasing.For this reason I am also very interested in downsampling my HTML5 screen. (4k-> 720p)

UPDATE: I noticed that the r.SetRes command is working. It seems this command affects the internal resolution of the HTML5 playout.When I set this to r.SetRes 3840x2160 I get a very good quality in my Browser. I guess it should be also possible to place everyting in an iframe to get the right size…

I got SetRes to work too but unsure how to resize the canvas so you can see the whole screen… Let us know if you manage to get it working.

UPDATE 2: The r.SetRes Command don´t work anymore. (4.11 Preview 7) I guess there is a bug in the HTML5 Engine.
At the moment my output is always a square resolution. But I need a 16:9 output. Very annoying. When I “play” my project in the mobile view, everything is ok. But in the Browser I get always this square resolution. I spend 3 hours to solve this problem. Without success…

Any news on this? I`m having the same problem here :frowning:

Thanks for the detailed information juj! This does address the resolution changing. I can add to this - if you change the above lines in your actual UE4/Engine dir i.e. UE4\4.XX\Engine\Build\HTML5\GameX.html.template , then that seems to keep the changes each time you build, so you can avoid having to do it every time (at least for PIE builds, not sure about packaged build).

I still seem to get a very blurry result on HTML5 compared to PC at the same resolution (see pic below)… I’m guessing now that this is not a resolution problem, but something to do with the HTML5 render target handling - any ideas to get this crisper? I have tried setting the PreInitEmscripten function to double the canvas resolution just to see if that would improve it but that doesn’t work. Then again I am on 4.10 so it might be worth trying on 4.11.


Ok actually the problem seems to be the resolution on the UE4 side - it is always rendering at 800x600 when run on HTML5 (I print the res to screen with a “Get Viewport Size” node), regardless of the canvas or emscripten render target size.

Setting this in HTML5Engine.ini seems to be ignored:


I’ve also tried setting r.setres in Device Profiles, but that doesn’t work either. Can’t find any reference of 800x600 anywhere in an .ini file, so not sure where it is getting that from.

Interestingly, if you try r.setres=1280x720 from the console in-game, it doesn’t work at first, but if you go r.setres=800x600 and then r.setres=1280x720, it changes the resolution successfully (but alas, then only the top left quarter of the screen is drawn on the canvas). It seems like it needs the resolution to be changed before the canvas is set up (or it’s just hard-coded at 800x600).

OK - I took the time to upgrade to 4.11 and I can confirm it all seems to work perfectly there! :slight_smile:

If anyone is encountering this problem in a later version of the engine than UE4.11, please start a new post.