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

Re: OGRE Renderer

01 Mar 2012, 20:26

Yes, it should be possible. There are two alternatives for this:
  • By using render to texture of the GUI and applying that texture to a object part of the scene
  • By using 3d projection (usually referred as 2.5D projection) of the GUi. There is a sample in the SDK showing that effect.
I understand that to have a decent version of NoesisGui in Ogre both options should be available.
 
nurbed
Posts: 3
Joined: 28 Feb 2012, 10:06

Re: OGRE Renderer

03 Mar 2012, 12:27

Hi,
I'm teaching at the Master on Computer Game Development at the Verona (it) university.
The beta version of Noesis is great, compliments... :D

For our project we are using Ogre 1.8.
Among other things, our goal is to produce a multiplatform game (Win, MacOS, Linux), so I want to know what is about the timeline for the integration of Noesis in Ogre, and if, after the integration, I will be able to run Noesis on other platforms...
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: OGRE Renderer

03 Mar 2012, 21:36

about the timeline, we are still in the first steps. I think people directly related with ogre will be able to give you a better estimation than me.

When the integration is finished, NoesisGui should be able to run in the intersection of platforms compatible with Noesis and those compatible with Ogre.
 
nurbed
Posts: 3
Joined: 28 Feb 2012, 10:06

Re: OGRE Renderer

10 Mar 2012, 10:12

Ok thanks!

May i have access to the bitbucket repository and/or the sample by Wolfmanfx? That would be a great starting point
 
User avatar
Wolfmanfx
Topic Author
Posts: 9
Joined: 18 Feb 2012, 19:21
Location: Austria
Contact:

Re: OGRE Renderer

10 Mar 2012, 12:10

@jsantos I am waiting for contact via skype
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: OGRE Renderer

10 Mar 2012, 17:12

yes, sent you an email...
 
Alexis
Posts: 2
Joined: 01 Mar 2012, 20:21

Re: OGRE Renderer

13 Mar 2012, 02:46

Ok thanks!

May i have access to the bitbucket repository and/or the sample by Wolfmanfx? That would be a great starting point
Hi there,
I would also very much like to access the repository.

Cheers,
Alexis
 
Slicky
Posts: 4
Joined: 22 Feb 2012, 16:56

Re: OGRE Renderer

13 Mar 2012, 04:01

I am also interested in trying out Ogre related offerings. I would give it a shot but not sure I could pull it off. I'd rather try and help others if possible.
 
User avatar
Wolfmanfx
Topic Author
Posts: 9
Joined: 18 Feb 2012, 19:21
Location: Austria
Contact:

Re: OGRE Renderer

13 Mar 2012, 21:53

Hi,
Right now i am studying the DXRS (from NoesisGUI) to create an OGRE renderer but in the mean time i can give the essential code hints how to render NoesisGUI with the DXRS.

1. Copy the Data & GUI folder in the same dir where you executeable is also all Noesis dll's (do not forget FreeImage.dll)
2. Start up the noesis system
		// Launch Noesis Kernel
		NsGetKernel()->Init();

		// Start Up Noesis Systems
		m_Device = NULL;
		m_pWindow->getCustomAttribute("D3DDEVICE", &m_Device);

		Noesis::Render::SetDX9Device(m_Device);
		NsGetKernel()->InitSystems();

		// Create surface for rendering vector graphics
		IDirect3DSurface9* backBuffer;
		m_Device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer);
		Noesis::Core::Ptr<Noesis::Render::IRenderTarget2D> color = NsGetSystem<Noesis::Render::IDX9RenderSystem>()->WrapRenderTarget(backBuffer);
		backBuffer->Release();

		IDirect3DSurface9* depthBuffer;
		m_Device->GetDepthStencilSurface(&depthBuffer);
		Noesis::Core::Ptr<Noesis::Render::IRenderTarget2D> mask = NsGetSystem<Noesis::Render::IDX9RenderSystem>()->WrapRenderTarget(depthBuffer);
		depthBuffer->Release();

		Noesis::Core::Ptr<Noesis::Drawing::IVGLSurface> surface = NsGetSystem<Noesis::Drawing::IVGLSystem>()->CreateSurface(color, mask);

		// Load UI resource
		Noesis::Core::Ptr<Noesis::Gui::IUIResource> guiResource = NsGetSystem<Noesis::Resource::IResourceSystem>()->Load("Gui/Samples/SDKTutorial/UI.xaml");
		m_UIRoot = guiResource->GetRoot();

		// Create the UI renderer
		m_UIRenderer = Noesis::Gui::CreateRenderer(m_UIRoot);
		m_UIRenderer->SetSurface(surface);
		m_UIRenderer->SetSurfaceClearMode(Noesis::Gui::SurfaceClearMode_Manual);
		m_UIRenderer->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_PPAA);
here the member def,
		Noesis::Core::Ptr<Noesis::Gui::IRenderer> m_UIRenderer;
		Noesis::Core::Ptr<Noesis::Gui::UIElement> m_UIRoot;
		IDirect3DStateBlock9* m_StateBlock;
		IDirect3DDevice9* m_Device;
3. Call Noesis update loop inside a renderqueue listener (m_pSceneManager->addRenderQueueListener(this))
Inside the renderQueueStarted do this
	void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation)
	{
		// We're going to render ourselves in the Overlay Queue 
		if(queueGroupId == Ogre::RENDER_QUEUE_OVERLAY)
		{
			if(!m_StateBlock)
				m_Device->CreateStateBlock(D3DSBT_ALL, &m_StateBlock);

			// Tick kernel
			NsGetKernel()->Tick();

			// Update UI
			m_UIRenderer->Update(1.0f/60.0f);

			// Draw surface
			m_StateBlock->Capture();

			m_Device->Clear( 0, NULL, D3DCLEAR_STENCIL, 0, 1.0f, 1 );
			NsGetSystem<Noesis::Render::IDX9RenderSystem>()->SyncInternalState();
			const Noesis::Core::Ptr<Noesis::Drawing::VGLCommands>& commands = m_UIRenderer->WaitForUpdate(); 
			m_UIRenderer->Render(commands);
			m_UIRenderer->WaitForRender();
			m_StateBlock->Apply();
		}
	}
Keep in mind this was just test code but it should help you to get started

cheers
 
Slicky
Posts: 4
Joined: 22 Feb 2012, 16:56

Re: OGRE Renderer

14 Mar 2012, 03:26

thanks - i'll give that a try.

Who is online

Users browsing this forum: No registered users and 74 guests