Inuyasha123
Topic Author
Posts: 19
Joined: 22 May 2019, 10:53

How do I make the UserControl of NoesisGUI display at the top level?

22 May 2019, 11:09

I have encountered a problem with the combination of Noesis and NGUI on Unity, I want to get your help. We have a need to display panels on 3D models.
My solution is to create a layout interface for the main interface of Canvas, then calculate the coordinates of the 3D model on the screen in each frame, and place the Noesis UserControl at the screen coordinates.
But I now add the NGUI UIRoot to the hierarchy tree and mount the NGUI UISprite under the UIRoot. The goal is to add a Sprite to each model and find that the Sprite under NGUI will block the Noesis panel. As shown below,
I know the reason is that Unity determines the rendering order by the depth of the camera. The depth of the Noesis camera is smaller than the depth of the Camera under NGUI, causing the Noesis panel to be drawn before the NGUI Sprite. How do I correctly ensure that Noesis's UserControl is drawn on top of NGUI's Sprite?
Image
Main.xaml
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Menu x:Name="menu" Grid.Row="0" Background="Black" Opacity="0.85">
            <MenuItem Header="File" FontSize="16" Foreground="White" Margin="5"/>
            <MenuItem Header="Edit" FontSize="16" Foreground="White" Margin="5"/>
            <MenuItem Header="View" FontSize="16" Foreground="White" Margin="5"/>
        </Menu>
        <Canvas x:Name="canvas" Grid.Row="0" Grid.RowSpan="2"/>

        <Border Grid.Row="2" Width="{Binding Path=ActualWidth, ElementName=menu}" Background="Orange">
            <TextBlock x:Name="txb" Text="Hello World" Foreground="White" FontSize="12" HorizontalAlignment="Center"/>
        </Border>
    </Grid>
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: How do I make the UserControl of NoesisGUI display at the top level?

25 May 2019, 10:15

For now, you only have two options to render NoesisGUI in Unity:
  • Render to texture
  • Render to camera, in this case the UI is always drawn at the end of the pipeline.
We are working in a new 3D-world mode that will allow you to do what you want to achieve, for now I think you need to use render to texture.
 
Inuyasha123
Topic Author
Posts: 19
Joined: 22 May 2019, 10:53

Re: How do I make the UserControl of NoesisGUI display at the top level?

26 May 2019, 04:56

Thanks for your help. I have tried the Render To Texture. In Unity's official documentation, the overhead of Render To Texture is too big, but we have a lot of many UserControl to be showd.
Consider of performace, we choose the canvas layout and calculate the coordinate of UserControl each frame. Not matter how many UserControl, the fps can be kept at a high level.
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: How do I make the UserControl of NoesisGUI display at the top level?

27 May 2019, 11:22

Have you considered rendering all the UserControls to the same texture (like in an atlas texture), then use that texture in several quads with different u,v coordinates?
The performance in that case should be similar to rendering directly to the screen.
 
Inuyasha123
Topic Author
Posts: 19
Joined: 22 May 2019, 10:53

Re: How do I make the UserControl of NoesisGUI display at the top level?

06 Sep 2019, 05:04

Which version will implement the 3D world mode, I really want to know. Your work is really great.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: How do I make the UserControl of NoesisGUI display at the top level?

06 Sep 2019, 10:36

That feature (#1465) is coming with the next major version (probably this year).
 
Inuyasha123
Topic Author
Posts: 19
Joined: 22 May 2019, 10:53

Re: How do I make the UserControl of NoesisGUI display at the top level?

16 Sep 2019, 03:56

Thank you very much

Who is online

Users browsing this forum: Google [Bot] and 36 guests