Hello everyone, I’m trying to make a summary of the situation (updated to 4.16) of fullscreen problems when playing a project packed for HTML (I’m testing on Firefox 53.0.3 64 bit)
How I’ve set up the test project:
- Create an FPS project for mobile
- Pack for html and try on browser
- Click on Fullscreen button
- See the project going fullscreen
- Press ESC to exit from fullscreen
- See the project viewport is corrupted (sometimes seems it’s not re-scaled and moved aside; sometimes seems it change the FOV of the camera as if it become a fisheye)
Test 1
In project setting → Input I un-tick “Enable FOV scaling”
Pack again and test on browser
Result: after exit from fullscreen the viewport is corrupted
Test 2
Go to the webpage of the Epic Zen Demo and try it: it goes in fullscreen and back without problems, so open the page source (in Firefox the shortcut is Ctrl+U), copy all and paste it into the basic notepad (or other similar software)
Take the previous packed project (the one used in Test 1) open the HTML file with the basic notepad (or other similar software)
I use a software that help to compare easily scripts in any languages: looking through our html I’ve seen that from line 366 there are some controls over fulscreen methods; comparing to the Epic Zen Demo page source the only difference in that zone is due to 395/397 lines (surely they aren’t standard number lines for any kind of projects but is just to give a reference where to look around)
I 've tried to simple copy them in my test project, save the html and test it again
Result: after exit from fullscreen the viewport is corrupted
Test 3 and 4
Take the previous packed project (the one used in Test 1 and 2) open the HTML file with the basic notepad (or other similar software):
go where you’ll find
// When entering fullscreen mode, should UE4 engine resize the canvas?
// 0=No resizing (do it manually in resizeCanvas()), 1=Resize to standard DPI, 2=Resize to highDPI
Module['UE4_fullscreenCanvasResizeMode'] = canvasWindowedUseHighDpi ? 2/*HIDPI*/ : 1/*Standard DPI*/;
(it’s 394-396 lines from my html) if you change the value
canvasWindowedUseHighDpi ? 2/*HIDPI*/ : 1/*Standard DPI*/
you get different results:
- with 0 when you go in fullscreen it
won’t change the dpi so basically
you’ll have a drop of quality but
after coming back from fullscreen the
viewport isn’t corrupted - with 1 or 2 when you go in fullscreen
it adapt the dpi to the new dimension
so basically you won’t have a drop of
quality (or a little if you use 1)
but after coming back from fullscreen
the viewport is corrupted
go where you’ll find
// Fullscreen scaling mode behavior (export these to Module object for the engine to read)
// This value is one of:
// 0=NONE: The same canvas size is kept when entering fullscreen without change.
// 1=STRETCH: The canvas is resized to the size of the whole screen, potentially changing aspect ratio.
// 2=ASPECT: The canvas is resized to the size of the whole screen, but retaining current aspect ratio.
// 3=FIXED: The canvas is centered on screen with a fixed resolution.
Module['UE4_fullscreenScaleMode'] = canvasWindowedScaleMode;
(it’s 386-392 lines from my html) if you change the value
canvasWindowedScaleMode
you get different results:
- with 0, 1 or 2: it uses different way to adapt the viewport to all the screen, but after coming back from fullscreen the viewport is corrupted
- with 3 (as it says in the description) it doesn’t change the dimension of the viewport, it just center it in the screen with black as background, but after coming back from fullscreen the viewport isn’t corrupted
I tried to tweak other options but I haven’t found other settings useful to reach different results from fullscreen (and my knowledge oh HTML is too low to find any other clues, so I’m still looking to find a way to go fullscreen and back without having quality drop in fullscreen, or corrupter viewport back from fullscreen.