- Home /
webplayer resolution problems/issues/oddities and frame rate weirdness
I can't get full screen playing in the webplayer to run at the native resolution of my screen, despite setting webplayer build to exactly the screen resolution. But more annoying, regardless what I set the webplayer resolution, I get aspect ratio stretching when going to full screen, AND it's playing full screen at a clearly lower resolution (blocky pixels) than the in browser setup.
How do I force fullscreen webplayer to a specific resolution?
I've tried this, http://answers.unity3d.com/questions/23307/webplayer-fullscreen-aspect-ratio-wrong , but it has no impact, other than showing me that at 1920 x 1080 I can get uber fluid frames per second for a while.
Which brings up another odd point, after a little time the webplayer frame rate degrades horribly, to well below 30 frames per second, at which point nothing brings it back up. I can refresh the page/reload the game, but the frame rate remains low. However if I rebuild, without changing anything other than the filename, it goes back up until the degradation occurs again.
I've watched memory and cpu usage during this degradation and gameplay, it doesn't change throughout.
Fullscreen play is not hampered by this framerate degradation.
What browsers/OSs have you tested this on? And on what browsers/OSs are you seeing this behavior?
tested on Safari, Firefox and Chrome. Btw there's some very interesting differences in initial frame rates between the three. Safari starts out highest, but degrades the worst. Firefox and Chrome start at about the same rate, not great rates, and Chrome degrades worse than Firefox. Unity webplayer seems to not work in Opera at the moment, nor does the search box in their documentation
Answer by Eric5h5 · Dec 27, 2010 at 01:51 AM
Setting the web player window resolution to your screen resolution can't work, because you always have window borders and stuff around the window. The web player will never go higher than the native resolution when switched to full-screen, so set the screen resolution (not the web player window resolution) to something like 9000 x 9000.
this may seem like a retard question, but think of me like a retard and it will all make sense. What is the difference between web player window resolution and screen resolution? Where is the setting for each? I'm currently changing :Unity:> Edit:> Project Settings:> Player Settings:> Resolution and Presentation:> Resolution
It worked for me as you reference my question, Eric5h5 is right set it to a higher res than what you actually want. Regards your issue with perf degradation, I had the same one test machine using vista, the first time I launched the app ( not web tho, exe), I was having sky high framerate, unbelievably fast, then I relaunched and was back to normal... very odd never could get it back to be that fast therafter.
@dissidently: There are several tabs in the player settings for web, stand-alone, etc. When you click on the web tab it says "Settings for Web Player", and when you click on the stand-alone tab it's also labeled appropriately. It's perhaps a little confusing that the stand-alone screen settings would apply to the web player in full-screen mode, but you can basically consider the web player full-screen mode to be "stand-alone"-ish.
No, that's beyond confusing. It's just plain stupid. Why have a webplayer setup button if it's not going to have the settings for webplayer full screen? For it to be buried in the "stand-alone" settings without ANY indication that's where it is or it's double purpose, that's stupid. Another iteration of "the Unity way". Anyone at Unity listening? Here's just one of the pages you SHOULD be telling the world how to set webplayer fullscreen resolution, but fail to: http://unity3d.com/support/documentation/Components/class-PlayerSettings.html
Answer by Barrett-Fox · Mar 28, 2011 at 11:56 PM
When switching to fullscreen, I'm getting better and more predictable results with:
Screen.SetResolution (9000, 9000, true);
vs.
Screen.fullScreen = true;
...than by depending on the project settings of the standalone & webplayer. Particularly when running in the webplayer, the first approach takes care of the resolution problem.
Where do I add that code. What do I attatch that script to?
Answer by ezonecom · Sep 22, 2014 at 06:32 AM
In Unity 4.5 you need to adjust the player settings for 'PC, Mac & Linux' - uncheck all the boxes for 'Supported Aspect Ratios', then you'll get fullscreen web playback.
Answer by tomekkie2 · Feb 12, 2012 at 11:02 AM
Have just found a solution based on the previous answers:
var fullscreenIcons: Texture[]; private var sw: int[]; private var sh: int[]; private var k: int = 0;
function Start () { sw = [Screen.width,Screen.currentResolution.width]; sh = [Screen.height,Screen.currentResolution.height]; }
function OnGUI () { //fullscreen switch if(GUI.Button (Rect(sw[k] - 60,20,40,40), fullscreenIcons[k])){ k = (k + 1)%2; if(k==0) Screen.SetResolution (sw[0], sh[0], false); if(k==1) Screen.SetResolution (Screen.currentResolution.width, Screen.currentResolution.height, true); }
Answer by Laurent_Lavigne · Mar 16, 2011 at 12:05 PM
Beacause I do not know ahead of time the full screen resolution for the webplayer, I set the standalone res to 9000x9000 When I go full screen the aspect ratio seems correct but the res is not 1900x1600