Search Unity

Supressing Mipmap Warning on WebGL

Discussion in 'Web' started by Picky-Salamander, Jul 1, 2015.

  1. Picky-Salamander

    Picky-Salamander

    Joined:
    Apr 26, 2013
    Posts:
    27
    I understand that mipmaps don't work on WebGL, but I want to be able to suppress the warning about it in a WebGL build. After our game has been running for a while there have been several thousand of these warnings logged to the console:

    Warning: Rendering to mipmap levels other than zero is not supported on this device

    It makes diagnosing actual problems really difficult when the browser log has been clogged by them.

    From what I understand, it's not possible to disable mipmaps per-platform and we want mipmaps on other platforms, so disabling mipmap generation on the relevant textures isn't an option. I could just replace the browser's console.warn function to detect and stop the warning, but that seems a little unnecessary to me.

    Basically what I want to know: Is there an easy way to disable/supress the warning?

    Thanks!
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Mipmaps are supported on WebGL. The warning is specific to rendering to mipmaps, which is not supported.

    We are going to investigate if there is a way to disable the warning, then get back to you here.
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Picky Salamander, my understanding is that you get that warning every frame. is that correct ?

    Do you know what's exactly triggering it ? perhaps a post-effect ?
     
  4. Picky-Salamander

    Picky-Salamander

    Joined:
    Apr 26, 2013
    Posts:
    27
    Thanks for the quick reply!

    It's not every frame: sometimes the warning will disappear for a while, but at it's worst it appears every frame. From what I've seen it can occur:
    • Seemingly randomly
    • Anytime we're loading a level
    • When we obscure the screen with a menu of some kind.
    We do run some post-effects... I will remove them and see if it has any effect.
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I'll wait for more info then, thanks!
     
  6. Picky-Salamander

    Picky-Salamander

    Joined:
    Apr 26, 2013
    Posts:
    27
    I narrowed it down, I get the warnings at two points:
    1. When we load a new scene for about 20 or so times until the scene is loaded.
    2. When the canvas element is re-sized or hidden. We allow the user to re-size the canvas window to help with frame-rate and we hide the canvas when an error occurs. This can also happen sometimes if you move the tab out of a window.
    I turned off our only post-effect (Antialiasing) and it seemed to have not effect.
     
  7. Andres-Fernandez

    Andres-Fernandez

    Joined:
    Feb 4, 2013
    Posts:
    57
    I'm suffering the same warning and I've figured out the 2 causes (in my case):
    • Post-effects
    • Render to texture (with a code pretty similar to the one in this thread)
    In the case of the post-efects, it triggers every frame for the edge detection effect and just one every time I toggle the ambient occlusion effect.
    Is it possible to set the mipmap count of the render textures? I guess the post-effects need to be reviewed more in-depth to see if I can fix them.
     
    Last edited: Jul 20, 2015
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Do you have a small project that generates a warning every frame ?
     
  9. Andres-Fernandez

    Andres-Fernandez

    Joined:
    Feb 4, 2013
    Posts:
    57
    I can't share because it's under nda stuff at work, but It's just a scene that loads a model and has the Edge detection effect on. That generates warning every frame.

    There are other effects on the camera that toggle on/off, such as Screen Space Ambient Occlussion and Color correction curves (for HDR stuff, although HDR is currently switched off right now).

    In the case of the warning being generated by rendering to a texture (basically to get a screenshot) I haven't been able to figure out how to avoid the warning.

    [Edit] Just made a quick scene to test and yes, got the warning (although not every frame). I'll try to upload a project (in the mean time it's just a blank scene with two objects and the edge detection effect on the camera).
     

    Attached Files:

    Last edited: Jul 22, 2015
  10. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    I've also had the warning, that I tracked down to mip maps. It occurred as the webgl app was about to start. Sometimes it seemed to clear itself after 15 mins or so and the app started.
    The fix was to turn off all the mip maps in the first scene. The error doesn't seem to occur again in subsequent scenes.
    Unity 5.3.7
     
  11. Picky-Salamander

    Picky-Salamander

    Joined:
    Apr 26, 2013
    Posts:
    27
    This disappeared for me a long time ago. Probably back in 2015, after I went to the next unity version.