Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

WebGL artifact

Discussion in 'Web' started by ArchVizPRO, Nov 20, 2015.

  1. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Hello
    I'm experiencing some (BIG) issue with WebGL and standard shader.
    With normalmaps i get many artifact. Here some screenshot:

    I see that in Unity 5.3.0f1 the situation is a little better... but still can't get rid of these artifact.
    I am missing something? There is some workaround?
    If this is a known problem.. any eta for a fix ?

    Thank you and best regards
    Ruggero
     
  2. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Here another closeup:
     
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    There was a late regression in our 5.3 standard shader improvements for webgl, which is getting fixed in 5.3.0f2 - please re-test using that when it is out (I guess some time this week).
     
    kenshin likes this.
  4. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I'm waiting for the original poster to confirm whether it does or not.
     
  6. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    ... is reasonable, I was impatient and curious to know whether or not to get back to work on WebGL
    Thanks for the answer :)
     
  7. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Unfortunately the artifacts are still there.
    I am using 5.3.0 f2.
    When this problem is going to be fixed?
    Thank you and best regards

     
  8. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    So, if you still get this in 5.3f2, please file a bug report with a repro case, so we can investigate what is going on. Please post the case number here.
     
  9. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    FWIW, the standard shader has seen significant improvements for WebGL in 5.3, which should fix *most* of the issues people have seen. But there are also still differences remaining between the desktop version (which I expect to go away in 5.4), so I'd have to check this project to see if this is expected due to those differences, and if you can work around it.
     
  10. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Bug report submitted ( Case 747796 )
     
  11. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I have tested too and I am experiencing similar problems with simple metallic material generated by substances.
    The visual artifact seems be generated by normal maps.
    In my case, as in this situation, seems that normal maps are note correctly rendered (especially with metals) if tilables.

    Please, Jonas keep us updated about the test feedback for this bug.
    Good luck! :)
     
  12. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  13. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Unity 5.3 webgl problem with standard shader too...
    The problem seem be normal map. If i leave the slot empty I see a lot of artifact in the reflection.
    If I use a map (but i don't always need) artifact seem disappear but the value of normal map doesn't work. It is always 1.
     
  14. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    The only solution I found is make shader with shaderforge...
     
  15. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Really???
    Please, could you post a screenshot?
     
  16. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    I wait for shader forge update because old shader doesn't work on 5.3...
    I think the problem is normal map in standard shader (in WEBGL) for 2 reason:
    - If i create new standard shader (without normal map) it works
    - standard PBR shader made with shader forge have normal map slot without weight value.

    Also...
    I have see 5.3 WebGL doesn't work anymore in chrome for OS X...
    WebGL publication work bad in firefox for OSX but is correct in firefox WIN...
     
  17. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I am still working on 5.2 because 5.3 seems to be less stable for webgl and carry a serious issue with ugui :(
     
  18. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    I try another way... Create a new standard surface shader and add normal map slot like see in manual... Seem work...
     
  19. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    If that's the case we would like to know more and possibly get bug reports! :)
     
  20. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Unity 5.3.1f1...... always the same problem. Artifacts from normal map are still there.
     
    Last edited: Dec 18, 2015
    kenshin likes this.
  21. sirrus

    sirrus

    Joined:
    Jun 10, 2012
    Posts:
    250
    We are also experiencing significant differences in what is rendered in the editor vs a webGL build for objects using a standard shader and normal map (see attached). The rock asset is downloaded via assetbundle.
     

    Attached Files:

  22. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    i will not bother you with technical details but it seems that it is due to some technical limitations of webgl (webgl 2.0 works fine, btw). We are looking into possible ways of "fixing" it
     
  23. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Seems that the main cause it the Cubemap mipmap.. without mipmap all is ok.
     
  24. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    >>Seems that the main cause it the Cubemap mipmap.. without mipmap all is ok.
    well, not really (but you are as close as you can get without getting your hands dirty with details)
    essentially you want to sample cubemap for "reflection" and the more rough object is the more blurry reflection becomes (to the point where it is just "color tint" if that makes sense). For this to work PBR uses texCubeLod which samples *specific* mip level of cubemap texture. Now, *obviously* (where is my "sarcasm" tag) webgl do not support this one (webgl2.0 does) so we try to imitate it with texCubeBias which is ridiculously wrong (and seems to be even kinda buggy on webgl itself on top). But sure - if there are no mipmaps on cubemap - no problem, though things would look a bit weird 8)
     
    kenshin likes this.
  25. prinzwurstbrot

    prinzwurstbrot

    Joined:
    Jul 28, 2015
    Posts:
    7
    I made my cubemap an advanced texture and disabled "Generate Mip Maps" but the artifacts are still there. Using Unity 5.4 beta it worked the first time, no artifacts ! Just a view seconds later, working on this simple scene (went to build settings / player settings and clicked on other settings) unity crashed. Sadly I now have the option of using a buggy beta or a stable version with artifacts ;) Only solution for me at that time is going back to marmoset shaders on 5.3.4, they (as well as legacy shaders) work just fine.

    Just wanted to say thank you for the work you put in the webgl development, Im always desperately looking forward to the next release !
     

    Attached Files:

  26. prinzwurstbrot

    prinzwurstbrot

    Joined:
    Jul 28, 2015
    Posts:
    7
    I tried the WebGL export with the latest beta (5.4 b22) and it worked on current browsers, BUT :
    When opening the page in Firefox 43 all the problems are back again. Jittery artifacts on reflection areas, no glossy mirror-like reflections at all, artifacts when using detailed bump.

    Only solution for me right now is using Marmoset Shaders, they work without a problem in WebGL, as long as you choose the mobile version of the Shader.
     
  27. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    So, it works on Firefox 46 but not 43? It could be that 43 does not expose some required extension. But, is running correctly in 43 actually a requirement for you? Since Firefox is auto-updating, very few people should still be on that.
     
  28. prinzwurstbrot

    prinzwurstbrot

    Joined:
    Jul 28, 2015
    Posts:
    7
    Thanks for the quick response !

    I did a bit of testing now and figured out the following :
    On my Windows PC the WebGL content (Standard and Marmoset / Moblie Shader) works like charme on both, Firefox and Chrome.

    Through browserstack I checked different Mac OS and it seems that Firefox always produces artifacts and sometimes disables the AA. Using Chrome or Safari is looking just fine. Also in Firefox on Mac OS I don't get sharp reflections as they get blurred no matter what smoothness value I choose.

    I thought I found a Firefox version that worked, but must have mixed up the systems, so it doesn't relay on the version of Firefox at all (i guess).
     
  29. DudoTheStampede

    DudoTheStampede

    Joined:
    Mar 16, 2015
    Posts:
    81
    Hi,
    I'm currently working on a project for WebGL with Unity 5.4b25 and I did some tests to make the best out of it (it's a project where quality is the crucial part).

    I'm working on Mac OS X (10.11.5) and I've seen the same described artifact problem in Firefox (47.0.1) but NOT in Chrome (51.0) on material with Normal Map. I'm also sure that in Windows on Chrome it's working too.
    We are using our own Shader, but I tested it with Standard Shader too and the problem is the same. In Firefox I also see a reflection error on a mesh with Standard Shader.
    Build without Normal Map makes everything works without artifacts even in Firefox (same material/shader, just without the normal map).

    Some news?