WebGl no UI Toolkit visible (BETA 6)

Hi,

i just tried the current Beta 6 with a new Project and a real simple UI ... works fine when running in Editor or Compiling to Windows Standalone ... but when compiling for WebGl the UI is not visible ... just the default skybox ...

do i miss something here? or did i encounter a bug?
Because when i look in this forum i see varius bug reports for webgl but all of them see the ui apparently and have other bugs..

Thanks!

Stupid question, but are you sure you built the correct scene? :p

[quote=“Bastienre4”, post:2, topic: 851819]
Stupid question, but are you sure you built the correct scene? :stuck_out_tongue:
[/quote]

Haha yes I do :slight_smile:
same scene settings for Windows and Webgl build … win shows ui buttons and the webgl does not

1 Like

Hi @mrSaig ,

Could you please submit a bug report with a reproduction project attached to it for this issue?


Yes just verified ... have the same issue with b7 ... just submitted the bug with a project and steps to reproduce

1 Like

In my experience with missing or pink materials in WebGL, it's often been a shader not being included in the build. This might not be the issue here, but worth noting in case that's all it is / for anyone else it might help.

The easiest way to see if it's related to the build missing a shader (and quickly resolve the problem, if so) is by creating a Shader Variant Collection. To do this, open Project Settings->Graphics tab, scroll to the bottom. It will say for example "100 shaders tracked, 250 variants." Click "Clear" beside that, it will immediately reset to just the currently-in-use ones. Enter Play Mode, you'll see it increase as additional ones are used by your game.

Once the content in question has been visible, while still in Play Mode, click "Save to asset...", save it somewhere, then exit play mode. Select (or drop) that asset to the "Preloaded Shaders" list. Build your project for WebGL and take a look in the browser - if the problem was a missing shader, it should now be visible.

If you want to avoid preloading your collection until a time of your choosing (such as after something initial displays), there is a checkbox "Preload shaders after showing first scene", and if you need more precise control over timing, you can create a reference to the asset in a script and call WarmUp at runtime whenever. See here for more information and additional links.

Also, if you only want to warm up a handful of specific shaders, you don't have to use the full collection as-is. You can select the Shader Variant Collection in the Project window then add/remove whatever through the Inspector.

Something else you could try before the above (if you haven't), is to double check the javascript console for any errors. It might just be that your game never reaches the point where the UI would display due to an overlooked exception. See here for more info on tracking down issues in WebGL builds.

6 Likes

Thanks for the detailed informations on shaders ... some was new to me so thanks!
But this issue still consists and was reproduced by unity ... you can vote on the issue here:

https://issuetracker.unity3d.com/issues/ui-toolkit-webgl-ui-is-not-visible-when-in-built-player-and-serialization-errors-are-thrown

1 Like