Search Unity

Black Screen/Window on Chrome

Discussion in 'Web' started by Jinxology, Jun 9, 2018.

  1. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    95
    Some of my beta testers are getting a black window in place of the game when playing in Chrome 66 and 67. It shows the loading bar and finishes loading, but at the moment it starts running, it goes to a blank black rectangle. Here's the dev console from one of the users, but I'm not sure how to interpret it. Does anyone have suggestions on how to debug this? Thanks in advance.

     
  2. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    95
    @Marco-Trivellato, curious if you have any thoughts on this? Could really use your advice! :)
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    - Can you ask them if they can run other Unity WebGL content? (for example this)
    - In the log you we print the list of webgl extension, maybe compare black canvas vs correct rendering list.
     
  4. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    95
    That tank game ran, but only for a few seconds before crashing. He's running the current version of Chrome on Windows 7 Professional. Here's the log:
     
  5. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    Hey, tried this on our Win7 test machines with latest Chrome but can not repro this with the tanks example. Can you provide us with a bug report that contains your project or a repro project so we can repro the error from your forst post? That'd be very nice.
     
  6. Darxide23

    Darxide23

    Joined:
    Jun 14, 2018
    Posts:
    2
    Hi all. I'm an end user, not a Unity developer, but I've been looking for a solution to this problem for months now. It's not just one Unity game, it's pretty much all of them. Any Unity game on Kongregate seems to give me a blank black box with little else when using Chrome. I'm currently using Chrome 67.0.3396.87, but as I've said this has been going on for months (at least 3 months) so it may have began with an earlier version of Chrome.

    Firefox does not give me any troubles with Unity content. The Tanks thing linked above displays seemingly ok, but it is incredibly unresponsive and choppy. After closing the tab I tried going back to it only to get the message that my browser does not support WebGL. I can't get the Tanks thing to load again.

    I would love for you all to find a solution to this issue and I'll help in any way I can. I do have a background as an amateur coder. I can read code for languages that I don't know and I understand debug messages, etc. Feel free to use me if you have need.

    Edit:
    Here's an example of what one game looks like in Chrome:

    And this is what it looks like in Firefox:
     
    Last edited: Jun 14, 2018
  7. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    95
  8. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    95
    Hey everyone,
    We've had some success debugging the troubled Windows 7 machine. Although the solution isn't perfect, it's a solution and I'm hoping we can work towards pinpointing the issue since I've seen it among other users as well.

    We discovered that if someone else logged in to the PC on a different account, both my game, and the tanks game, worked. We then later discovered that if we logged in as the user having trouble and renamed the directory containing the Chrome settings at c:/Users/[username]/AppData/Local/Google/Chrome (in essence deleting it), both games worked for him! Chrome would automatically create all new settings of course, and that is what fixed it. So, somewhere within the settings, there was some flag or setting that was causing all the WebGL issues.

    I should mention for posterity, we initially tried "Settings > Restore settings to their original defaults" for the troubled user, and that did not fix the problem. We had to rename that Chrome settings folder.

    The downside to this solution, of course, is that the user is losing all their Chrome data (cookies, passwords, other save games, etc). Ideally, we can figure out what in the Chrome settings is causing this issue so we can flip the problem setting/flag.

    (CC @Schubkraft , @Marco-Trivellato , @Darxide23 )
     
    Darxide23 likes this.
  9. Darxide23

    Darxide23

    Joined:
    Jun 14, 2018
    Posts:
    2
    That is unfortunate. I think I can hold out and see if you find the cause so that maybe I can just clear out the offending files and let them be rebuilt instead of nuking my entire profile, which is definitely less than ideal.
     
  10. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    We're also seeing black screen issues in Chrome, but there seems to be a very specific reason to do with multi sampling.
    INVALID_OPERATION: renderbufferStorageMultiSample: samples out of range

    Setting anti aliasing to off causes the blackness to go away and the rendering to show up.

    reported as Bug Case 1053885
     
  11. weber-jaroslaw-dmm

    weber-jaroslaw-dmm

    Joined:
    Mar 30, 2017
    Posts:
    14
    Can play game if turn hardware acceleration on. But need the user to turn it on manually...

    Also can reproduce by turning it off.

    Chrome only.
    Unity 2018.2.6f1
     
    Last edited: Dec 7, 2018
  12. Gillissie_BnC

    Gillissie_BnC

    Joined:
    Oct 30, 2018
    Posts:
    4
    I would love it if Unity could address this issue.
     
  13. mattkenefick

    mattkenefick

    Joined:
    Aug 24, 2017
    Posts:
    5
    I also have this.

    It was fixed by going to Chrome -> Settings -> Advanced Settings -> Enable Hardware Acceleration , then Relaunch.
     
  14. garza

    garza

    Joined:
    Dec 18, 2013
    Posts:
    30
    i'm getting this same thing, but my hardware acceleration is on.
    i'm on Unity 2019.1
     
  15. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    im seeing the same thing with Unity 2018.1 WebGL build running in CHROME. The black screen is not there all the time, it comes randomly and appears to happen when i change scenes, maybe not the first time i change scenes, but the second or third, or fourth time ( seems random), the whole screen becomes pitch black. Only way out is to close the browser and start over.

    Maybe its something to do with the post processing i have connected to the camera???
     
    Last edited: Jun 24, 2019
  16. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    We're seeing this more and more now with the latest version of Chrome.
    At least one person has had success with renaming this directory c:/Users/[username]/AppData/Local/Google/Chrome as Jinxology suggested
     
    Last edited: Jul 24, 2019
  17. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    To let you know my black screen turned out to be a null pointer in my code that caused a crash, so it wasn't unity engine causing it.
     
  18. siangicher

    siangicher

    Joined:
    Jul 3, 2019
    Posts:
    1
    private bool IsHardwareAccelerationOn
    {
    get { return !SystemInfo.graphicsDeviceName.Contains("SwiftShader"); }
    }

    if(IsHardwareAccelerationOn == false)
    {
    AspectUtility.MainCamera.allowMSAA = false;
    QualitySettings.antiAliasing = 0;
    }
     
  19. zeroisthenew1

    zeroisthenew1

    Joined:
    Jun 20, 2018
    Posts:
    8
    I am getting the same issue. "Disabling Antialiasing if Hardware Acceleration is false" make it work, but it works with ONLY 2-5 FPS. On the other hand in Firefox it works 60fps@60hz flawlessly.

    I get this on Radeon mobile graphic card. Is there any correlation with this? Can you confirm that?

    More important than that, we need a solution. Hardware Acceleration is on in Chrome's settings. Still get this error. How to make that WebGL build work with Hardware Acceleration?
     
    Howard-Day likes this.
  20. WilliamHerring

    WilliamHerring

    Joined:
    Aug 29, 2020
    Posts:
    4
    So it seems to be a problem with safari as well as chrome now (I tried both since my project has the same issue). I’ll try firefox later but I’m guessing it’s the browser’s fault. What confuses me is my previous game (built with same version of unity) worked. However this newer game doesn’t work. It is a much larger project so maybe do I need to allow more space or something in project settings? Oh, and it doesn’t work on mobile browsers either.
     
  21. DryreL

    DryreL

    Joined:
    Feb 23, 2020
    Posts:
    49
    I have same problem with Opera. Chrome can run the game but Opera can't. Also loading screen doesn't shown up, yet chrome loads the game. That's really strange. Unity version is 2020.2.1f1
     
  22. Ranom

    Ranom

    Joined:
    Oct 10, 2012
    Posts:
    49
    Get them to open "chrome://gpu" and see if hardware acceleration is disabled?
     
  23. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    548
    Please file a bug report using Unity. They don't fix bugs unless it's on the issue tracker.
     
  24. christopf

    christopf

    Joined:
    Dec 28, 2015
    Posts:
    17
    I still had the black screen issue and got this error message:

    Access to XMLHttpRequest at 'file:///C:/Users/path/file.data.gz' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.


    It might be silghtly different from those above though my search for a solution brought me here and nothing from aboive worked for me. Though emulating a webserver in your directory of desire (or uploading the file somewhere i guess) did for me.

    You can find multiple solutions over here https://stackoverflow.com/questions...supported-for-http-error-when-loading-a-local

    However, of the named solutions works Twisted works best for me. More discussion on that you find over here https://stackoverflow.com/questions...ve-to-pythons-http-server-or-simplehttpserver
     
  25. DaneyT

    DaneyT

    Joined:
    Aug 24, 2017
    Posts:
    4
    I had the same problem on a iPhone with iOS 14.4.4 and unity WebGL build with Unity 2020.2.5f1. Android and PC was working fine with their browsers. But not one browser worked on the iPhones. Just a black screen after the loading bar and Made with Unity message.
    I previously disabled Enable Exceptions in the Player -> Publish Settings.
    The fix was to turn it back on with: Full without Stacktrace.
    After enabling and building the iPhones loaded the game properly again. Maybe this will help someone
     
  26. HZ51

    HZ51

    Joined:
    Jul 28, 2016
    Posts:
    42
    I had the same problem with Unity 2022.2.0b1.2674. My simple webgl game works on Chrome both in windowed and in fullscreen mode and it works fine in firefox windowed mode but doesn't work in FireFox Fullscreen mode (black screen).
    Seems these problems with a black screen last forever.