Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Web GL experiences

Discussion in 'Unity 5 Pre-order Beta' started by grosssmutttr, Nov 26, 2014.

  1. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Hi there,

    just wanted to collect my WebGL experience:

    I used a mobile game (Android) and switched platform to WebGL.

    When I start the index.html with Mozilla Firefox every sound is played.
    But not at the same time, one by one.

    Here are the errors from the browser console:
    "Unable to find type [UnityEngine.dll]UnityEngine.Rendering.SphericalHarmonicsL2
    " Build.js:10380
    _JS_Log_Dump() Build.js:10380
    __Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryE() Build.js:1386852
    __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryE() Build.js:1386569
    __Z26FillCommonScriptingClassesR22CommonScriptingClasses() Build.js:1314586
    __ZN11MonoManager13AwakeFromLoadE17AwakeFromLoadMode() Build.js:1088666
    __ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode() Build.js:1327226
    __ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv() Build.js:1326994
    __ZN17PersistentManager27IntegrateAllThreadedObjectsEv() Build.js:1331248
    __ZN17PersistentManager10ReadObjectEi17AwakeFromLoadMode() Build.js:1332112
    __Z31ReadObjectFromPersistentManageri() Build.js:864389
    __Z24PlayerLoadGlobalManagersPKc() Build.js:880791
    __Z24PlayerInitEngineGraphicsb() Build.js:1217693
    _main() Build.js:1945459
    callMain() Build.js:2638142
    doRun() Build.js:2638199
    run/<() Build.js:2638211

    "Unable to find type [UnityEngine.dll]UnityEngine.SharedBetweenAnimatorsAttribute
    " Build.js:10380
    _JS_Log_Dump() Build.js:10380
    __Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryE() Build.js:1386852
    __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryE() Build.js:1386569
    __Z26FillCommonScriptingClassesR22CommonScriptingClasses() Build.js:1316608
    __ZN11MonoManager13AwakeFromLoadE17AwakeFromLoadMode() Build.js:1088666
    __ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode() Build.js:1327226
    __ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv() Build.js:1326994
    __ZN17PersistentManager27IntegrateAllThreadedObjectsEv() Build.js:1331248
    __ZN17PersistentManager10ReadObjectEi17AwakeFromLoadMode() Build.js:1332112
    __Z31ReadObjectFromPersistentManageri() Build.js:864389
    __Z24PlayerLoadGlobalManagersPKc() Build.js:880791
    __Z24PlayerInitEngineGraphicsb() Build.js:1217693
    _main() Build.js:1945459
    callMain() Build.js:2638142
    doRun() Build.js:2638199
    run/<() Build.js:2638211

    "Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.

    Perhaps there is somebody who knows the problem :D

    Except these errors I'm very surprised how good this already works...
     
  2. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Hello,

    it looks like these two types get stripped by our stripping system. Could u please file a bugreport with a small reprocase?

    As a temporary workaround, you might want to add to one of your MonoBehaviours a public method that creates two instances of these missing types in two local variables, and then Debug.Log them.
    By doing so, you make sure that the two types are marked as "used" by the system, and shouldn't be stripped.
     
    twobob likes this.
  3. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    I sent a bug report.

    Don't know which type the variables should have?
     
  4. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    One is UnityEngine.Rendering.SphericalHarmonicsL2, the other one is a attribute (UnityEngine.SharedBetweenAnimatorsAttribute) so if you cannot instantiate it, just mark one of your MonoBehaviours with it and you should good to go.
     
  5. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Don't know what you mean :D

    When I include this in a MonoBehaviour class it isn't found:
    using UnityEngine.Rendering.SphericalHarmonicsL2;
    using UnityEngine.SharedBetweenAnimatorsAttribute;

    I also can't do something like:
    public SphericalHarmonicsL2 test;
    public SharedBetweenAnimatorsAttribute test2;

    Perhaps because I'm in a 2D project?
     
  6. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Not sure why SphericalHarmonicsL2 does not exist, probably it is an internal type and in that case your only option is to wait for the fix in one of the upcoming betas :)

    For the attribute instead, you can always do

    var type = typeof(UnityEngine.SharedBetweenAnimatorsAttribute);

    To make sure the type is referenced. However, given the situation probably it is easier for you to wait for the upcoming fix :)
     
    d12frosted and grosssmutttr like this.
  7. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Here are additional errors:
    1. run() called, but dependencies remain, so not running(index):109 Module.printErrBuild3.js:2639496 runBuild3.js:2639607 (anonymous function)
    2. Texture is not accessible.
    Build3.js:10386 _JS_Log_DumpBuild3.js:1386859 __Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryEBuild3.js:1386576 __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryEBuild3.js:1140064 __ZNK9Texture2D12ExtractImageEP14ImageReferenceiBuild3.js:1945311 __ZN7Cursors9SetCursorEP9Texture2D8Vector2f10CursorModeBuild3.js:1945376 __ZN7Cursors17InitializeCursorsEP9Texture2D8Vector2fBuild3.js:1221360 __ZN14PlayerSettings18InitDefaultCursorsEvBuild3.js:1221250 __ZN14PlayerSettings19PostInitializeClassEvBuild3.js:867358 __ZN6Object23CallPostInitializeClassEvBuild3.js:1238214 __Z24InitializeEngineGraphicsbBuild3.js:1217679 __Z24PlayerInitEngineGraphicsbBuild3.js:1945541 _mainBuild3.js:2639463 callMainBuild3.js:2639520 doRunBuild3.js:2639532 (anonymous function)

    Issue 2 is the cursor texture I set in default cursor texture.
     
    Last edited: Nov 27, 2014
  8. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Are these issues part of the same bugreport you already filed?
     
  9. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Yes, but I just recognized these issues after uploading the project on my server.
    I haven't described the issues in the bug report but it should be reproducable...

    If you like I can send you the link of the uploaded project as pm?

    And do you know why all the sound files are played automatically one by one?
    I changed the Default Settings in every audio file.
    1. Checked the "Override for WebGL"
    2. selected "Compress in Memory", Compression Format "MP3" and Sample Rate Setting "Preserve Sample Rate"
    3. Preload Audio Data is checked
     
    Last edited: Nov 27, 2014
  10. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    The sounds shouldn't be played one by one. If that happens it means there is an issue with your project or a bug in WebGL.
    We are going to investigate on the issues in your project soon though, so expect a fix in one of the upcoming betas.
     
    grosssmutttr likes this.
  11. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    1. Ok the cursor thing works now but not completely. Had to change the texture type to "cursor" :) Didn't know that this exists...

    It works for two scenes and after changing to another scene the cursor is the default windows cursor...

    I added the following in my Update() method:
    if(Input.GetMouseButtonDown(1))
    {
    // Get mouse origin
    mouseOrigin = Input.mousePosition;
    isPanning = true;
    Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
    }

    if (!Input.GetMouseButton (1)) {
    isPanning = false;
    Cursor.SetCursor(cursorTextureDefault, hotSpot, cursorMode);
    }

    Now it works but the log of the console in chrome and firefox is filled with:
    Resource interpreted as Image but transferred with MIME type image/cur: "data:image/cur;base64,AAACAAEAKCgAAAAAAAAoGQAAFgAAACgAAAAoAAAAUAAAAAEAIAAAA…AwGQAwMBkAMDAZADAwGQAwMBkAMDAZADAwGQAwMBkAMDAZADAwGQAwMBkAMDAZADAwGQAwMBkA".

    2. I can see some black lines under and beside UI Texts...

    3. The scroll direction of the Scrollview (scrolling content) is vice versa to Android, iOS, Windows Phone, Web Player

    Perhaps you can add this to the filed bug report.
     
    Last edited: Nov 30, 2014
  12. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Just downloaded beta 16. When I build the app following error occurs:
    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.AnimationWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/Deprecated/AnimationWindow.cs:1307)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    The build finishes but this error appears....

    When I upload the app to the webspace this is the console output:
    Unable to find type [UnityEngine.dll]UnityEngine.AssemblyIsEditorAssemblyAttribute
    Build4.js:9709 _JS_Log_DumpBuild4.js:1398557 __Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryEBuild4.js:1398274 __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryEBuild4.js:1328152 __Z26FillCommonScriptingClassesR22CommonScriptingClassesBuild4.js:1100482 __ZN11MonoManager13AwakeFromLoadE17AwakeFromLoadModeBuild4.js:1338959 __ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadModeBuild4.js:1338775 __ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEvBuild4.js:1342981 __ZN17PersistentManager27IntegrateAllThreadedObjectsEvBuild4.js:1343845 __ZN17PersistentManager10ReadObjectEi17AwakeFromLoadModeBuild4.js:873668 __Z31ReadObjectFromPersistentManageriBuild4.js:890125 __Z24PlayerLoadGlobalManagersPKcBuild4.js:1229580 __Z24PlayerInitEngineGraphicsbBuild4.js:1957593 _mainBuild4.js:2653263 callMainBuild4.js:2653320 doRunBuild4.js:2653332 (anonymous function)

    This error still exists:
    run() called, but dependencies remain, so not running(index):136 Module.printErrBuild4.js:2653296 runBuild4.js:2653407 (anonymous function)
    I think this error appears because of the long loading time:
    pre-main prep time: 2538 ms(index):63 Module.printErrBuild4.js:3178005 doRunBuild4.js:3178021 (anonymous function)
     
    Last edited: Dec 5, 2014
  13. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Neither of those outputs should be causing any trouble, though.

    "Unable to find type [UnityEngine.dll]UnityEngine.AssemblyIsEditorAssemblyAttribute" is known and will be fixed in an upcoming build. It should not stop your game from running.

    "run() called, but dependencies remain, so not running(index):" comes from emscripten, but is basically just telling you that it is still waiting for data to download before starting.
     
  14. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    All the audio files are still played one by one and since beta 16 the animations don't work anymore...They act completely crazy :)

    Perhaps the animation thing is this:
    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.AnimationWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/Deprecated/AnimationWindow.cs:1307)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    Animations and audio is played as expected when I run it in the Unity Editor (Game view)....
     
  15. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    b17 should bring a bunch of fixes related to Audio, I hope this one as well. As for the animation, can you file a bug?
     
  16. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
  17. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Now I got these errors in unity:
    AssertionException: Expected: not null
    But was: null

    NUnit.Framework.Assert.That (System.Object actual, IResolveConstraint expression, System.String message, System.Object[] args)
    NUnit.Framework.Assert.IsNotNull (System.Object anObject)
    UnityEditor.Graphs.AnimationStateMachine.Graph.BuildGraphFromStateMachine (UnityEditor.Animations.AnimatorStateMachine stateMachine) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/Graph.cs:60)
    UnityEditor.Graphs.AnimationStateMachine.Graph.RebuildGraph () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/Graph.cs:55)
    UnityEditor.Graphs.AnimatorControllerTool.RebuildGraph () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Animation/AnimatorControllerTool.cs:302)
    UnityEditor.Graphs.AnimatorControllerTool.StateDirty () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Animation/AnimatorControllerTool.cs:297)
    UnityEditor.Graphs.AnimatorControllerTool.UndoRedoPerformed () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Animation/AnimatorControllerTool.cs:276)
    UnityEditor.Undo.Internal_CallUndoRedoPerformed () (at C:/buildslave/unity/build/artifacts/generated/common/editor/UndoBindings.gen.cs:166)

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.AnimationWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/Deprecated/AnimationWindow.cs:1307)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    Just created a new 2d Sprite with a canvas in it. In this canvas I added a text ui....
     
  18. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    This seems to be a bug, but has nothing to do with WebGL. So, yeah, i guess you should report it, but I don't think you will find help in this thread.