tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Noesis 2.0 and Unity 5.6

05 Apr 2017, 12:15

Hi there,

Yesterday, I decided to “upgrade” my full project, switching from Unity 5.4 / Noesis 1.2 to the latest Unity 5.6 and Noesis 2.0.

I updated the syntax of my views and my various usercontrols, so that they load the XAML content from the constructor. The syntax is now OK, scripts are compiling flawlessly.

At first, I ran into a first major issue : If I tried to merge resource dictionaries being included in a subfolder of a Resources folder, it seems that Noesis wasn’t able to find them :

Eg. :
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Resources/XAML/RD_CommonColors.xaml"/>
            </ResourceDictionary.MergedDictionaries>
Has to be replace by :
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Common/XAML/RD_CommonColors.xaml"/>
            </ResourceDictionary.MergedDictionaries>
Once this issue found, I was able to display any XAML file that was not referencing any of my UserControl (no issue with CustomControl) : But, any of my xaml file referencing an user control doesn’t seem able to load the given UserControl.

In the Unity Workspace, the new XAML preview doesn’t appear, and I have the following message :
NoesisException: Xaml not found 'Assets/Covirtua/Orthophonie/Common/Controls/WaitingScreenControl.xaml'
Noesis.Error.Check () (at Assets/NoesisGUI/Plugins/API/Core/NoesisError.cs:21)
The message disappears if I force the xaml .asset regeneration (eg by deleting the XAML and asset file, switching to Unity, and undoying the file deletion so that it recreate the asset file). In this case, the UserControl appears correctly in the Unity property panel preview.

When running, it may either show the following error :
Exception: Xaml not found 'Assets/Covirtua/Orthophonie/Common/Controls/WaitingScreenControl.xaml'
NoesisXaml.Load () (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:26)
NoesisView.LoadXaml (Boolean force) (at Assets/NoesisGUI/Plugins/NoesisView.cs:311)
NoesisView.OnEnable () (at Assets/NoesisGUI/Plugins/NoesisView.cs:370)
Or even crash Unity.
Any idea ?

Regards,

Roland
 
tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Re: Noesis 2.0 and Unity 5.6

05 Apr 2017, 12:40

Ok, got some of my scenes running, by referencing some of my UC from the "Preloaded XAML" section of the Noesis Settings view. In fact, as they were directly referenced in XAML, I thought that Noesis would have "include" them by default.

I still have some scene crashing (and crashing Unity) when opened ! I'll investigate and keep updating this post .
 
tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Re: Noesis 2.0 and Unity 5.6

05 Apr 2017, 14:09

OK, it also seems that my previous issues were directly related to the "importation" order of the various XAML. The fact that I was updating an existing project (created using 1.2) was probably causing some kind of internal mess. Using the "reimport" function of the various XAML files (to regenerate assets) seems to be a life savior and solves a lot of problems. The trick is, to do it in the right order.

[Edit] Another found issue : Copying a WPF style the one below causes no error at "asset building time", but leads to a runtime error ( because of the Stylus.IsFlicksEnabled property not being defined / it was ignored in Noesis 1.2 ).
    <Style x:Key="TextBox_Style" TargetType="{x:Type TextBox}">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
 
nokola
Posts: 188
Joined: 10 Mar 2015, 05:29

Re: Noesis 2.0 and Unity 5.6

07 Apr 2017, 07:27

Seeing similar issue here. We have to spend about an hour reimporting our (many) XAMLs in the correct order until finally the views load, and some XAMLs still crash Noesis.

Trying to get a small/minimal repro for the last 40 minutes, but couldn't even load the Buttons sample on Unity 5.6 in a Blank 3D project after import/reimport/etc. Reported issue: https://bugs.noesisengine.com/view.php?id=1046

Edit: the issue you are seeing may be related to code-behind? Started a new thread on that topic here: viewtopic.php?f=3&t=1057
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Noesis 2.0 and Unity 5.6

11 Apr 2017, 16:23

We've been fixing some issues related to Unity xaml procesing that should solve your problems.
But we are still working on adapting NoesisGUI to Unity 5.6 version changes. As soon as we are done we will release a new version.

Sorry for the inconveniences.
 
nokola
Posts: 188
Joined: 10 Mar 2015, 05:29

Re: Noesis 2.0 and Unity 5.6

12 Apr 2017, 02:55

Good to hear, thanks for the update!
 
tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Re: Noesis 2.0 and Unity 5.6

19 Apr 2017, 13:08

Hi there !

Back after two weeks of other duties, I've almost completed porting my app to Noesis 2.0.

First of all, thanks Jesus for the incoming fix !

As a matter of feedback, the following notes may help other people :

* For the transparent bitmap, as said in another thread (viewtopic.php?f=3&t=1036&p=5843&hilit=magick#p5843), you'll need to premultiply alpha, and uncheck this fuc*** "Alpha is Transparency" checkbox in Unity (otherwise, premultipliing is useless)
* If you are using Atlases with ImageBrushes with absolute viewport coordinates, be aware that absolute coordinates will refer to the image size after Unity processing : If you set up a different max size for your images on Android and Ios, for example, you'll probably encounter placement issues.
* If you have a very large font ( ROBOTO in 120 pt in my case), the spacing over the fond will not be the same than in WPF, and than in Unity 1.2, breaking your design. Consider using smaller font size and appliing a RenderTransform to your text
* I still have a blocker : Rendering a camera to bitmap, with a Noesis overlay may crash Unity, without any way to intercept the exception. I'll edit this post with a repro asap.
 
tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Re: Noesis 2.0 and Unity 5.6

20 Apr 2017, 13:26

Some additions on encountered issues. As I'm on the porting process, it's quite complicated to elaborate a bug ticket for any of them, and since I've found workaround for most of them, it's OK, at least for me !

* In my application, I've a video streaming of what's displayed. In 1.2, I was doing this, on a corouting of a persistant gameobject :
                    // get the main camera
                    var refCamera = Camera.main;
                    // Prepare a render texture
                    RenderTexture refNewRenderTexture = new RenderTexture(nCaptureWidth, nCaptureHeight, 24);
                    // Set the render texture to the camera
                    refCamera.targetTexture = refNewRenderTexture;
                    // .. and render it !
                    refCamera.Render();
                    // Unset the render texture from the camera.
                    refCamera.targetTexture = null;
 
Doing this in 2.0 crashes Unity (and the app) when switching space, or when changing the capture resolution. So, I'd to use Texture2D.ReadPixel (and then perform a resize to my capture size).
There's still issues :
* By default, if you've Clear flags on your camera (eg., Solid Color), it will result as a black capture in the Windows Runtime (not in the editor).
* If you set up the "Enable Post Process", you'll have your bitmap, but mirrored vertically, and the "Flip vertically" property isn't available anymore, so you're stuck
* So, for now, the only way I found is to setup the Clearflags to None.
* Now it's OK, and words for fullscreen GUIs. For overlay guis (on another Camera, for example, dedicated to the UI), it's more complicated : I cannot change the Clear flags attribute of the camera, and if I enable post process, the GUI is still flipped vertically.

Two other minor bugs :
* I use GIT for my source repository. When I synchronized another computer, still on 1.2, with my updated version, the "Preloaded Xamls" array was not fullfilled.
* The "Enable Post Process" of the Noesis View doesn't invalidate the state of a space for Unity. So if you leave the space without modifying anything else, your change to this property is not saved.
 
tomczak
Topic Author
Posts: 30
Joined: 26 Mar 2014, 10:25

Re: Noesis 2.0 and Unity 5.6

20 Apr 2017, 16:11

A annoying point for people working with VR and Oculus :

- On Unity 5.6.0f3, the Windows Runtime crashes, when using Oculus, if a camera "Allow HDR" property isn't set to TRUE.
- However, setting "Allow HDR" to TRUE on a Camera associated with a NoesisView leads to the Error :"GL.End requires material.SetPass !".

The case is annoying when you have a Non-VR space (eg. : Menu ), and when you should switch off VR when entering the space. HDR has to be set to TRUE, otherwise the app will crash. The only way I found was to set up the HDR status of any camera (even in non VR space) to TRUE, and remove it when entering space.
 
User avatar
jsantos
Site Admin
Posts: 3918
Joined: 20 Jan 2012, 17:18
Contact:

Re: Noesis 2.0 and Unity 5.6

25 Apr 2017, 03:01

Hi tomczak,

Thanks a lot for your feedback! Many of your problems should have been resolved in the last 2.0.1 we released today. Could you please move pending issues to the tracker?

Could you also elaborate about this?
If you have a very large font ( ROBOTO in 120 pt in my case), the spacing over the fond will not be the same than in WPF, and than in Unity 1.2, breaking your design. Consider using smaller font size and appliing a RenderTransform to your text
At 120 we are rendering the glyphs using meshes instead of bitmaps but the spacing should be exactly the same as at smaller sizes. Could you paste a screenshot about it here please?

Who is online

Users browsing this forum: Ahrefs [Bot], MaskARRA, Semrush [Bot] and 16 guests