igorsegalla
Topic Author
Posts: 9
Joined: 07 Jan 2020, 00:02

Using an existent device (OpenGL)

07 Jan 2020, 02:42

Hello,
I am trying to integrate NoesisGUI with Urho3D game engine, but I dont understand how I can get the renderer device already created by Urho3D, into NoesisGUI.

I need to implement by myself the Noesis::RenderDevice, Noesis::Texture, Noesis::RenderTarget interface? Or I can simply set a OpenGL device (I am using OpenGL on Urho3D) at some NoesisGUI part and it's done?

Im really confused about it, consdering I will not use the NsApp on my implementation source.
Thanks.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using an existent device (OpenGL)

07 Jan 2020, 13:00

This is a minimal sample without App library and using an external context created by GLUT:

https://github.com/Noesis/Tutorials/tre ... rationGLUT

It is using our reference GLRenderDevice implementation.
 
igorsegalla
Topic Author
Posts: 9
Joined: 07 Jan 2020, 00:02

Re: Using an existent device (OpenGL)

07 Jan 2020, 23:31

Cool. I managed to implement into my game, but the background is always black.
Image

Should be rendered on top of this screen, but isn't:
Image

Do you know why? Im calling view->render at Graphics::EndFrame (Urho3D), I tried to use glPushAttrib( GL_ALL_ATTRIB_BITS ); too, but doesnt work.
Thanks.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using an existent device (OpenGL)

08 Jan 2020, 15:14

That XAML is probably setting the background to black. Could you please paste it here?
 
igorsegalla
Topic Author
Posts: 9
Joined: 07 Jan 2020, 00:02

Re: Using an existent device (OpenGL)

08 Jan 2020, 16:50

 <Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
            <Viewbox>
                <StackPanel Margin="50">
                    <Button Content="Hello World!" Margin="0,30,0,0"/>
                    <Rectangle Height="5" Margin="-10,20,-10,0">
                        <Rectangle.Fill>
                            <RadialGradientBrush>
                                <GradientStop Offset="0" Color="#40000000"/>
                                <GradientStop Offset="1" Color="#00000000"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                </StackPanel>
            </Viewbox>
        </Grid>
Dont have background defined on XAML, so I guess xaml layout isnt the problem.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using an existent device (OpenGL)

08 Jan 2020, 18:00

Could you use RenderDoc to analyze API calls? There must be a clear to black somewhere and I am quite confident it is not Noesis. 😀
 
igorsegalla
Topic Author
Posts: 9
Joined: 07 Jan 2020, 00:02

Re: Using an existent device (OpenGL)

08 Jan 2020, 18:48

Hmm its weird cuz removing view->Render is normal, so must have some Clear into view->Render.
The order of RenderOfScreen matters?

ll debug with RenderDoc.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using an existent device (OpenGL)

08 Jan 2020, 18:59

Yes, order of offscreen is very important. It must be done before binding the main render target. The offscreen phase may also bind an internal framebuffer, make sure to rebind your main buffer again.
 
igorsegalla
Topic Author
Posts: 9
Joined: 07 Jan 2020, 00:02

Re: Using an existent device (OpenGL)

08 Jan 2020, 19:08

When I call _view->GetRenderer()->UpdateRenderTree();, is bugging the Vertex Shader input. For this nothing is being drawn on screen...

Image
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using an existent device (OpenGL)

08 Jan 2020, 19:12

Render and RenderOffscreen do change GL state, you need to restore it accordingly to your needs.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 63 guests