MyGUI with Direct3d11
I have compiled MyGUI 3.2.0 against the latest version of Ogre, 1.9RC2. I also compiled all the demos. I successfully ran the demos when selecting Direct3d9 Rendering Subsystem in the OGRE Engine Rendering Setup and also OpenGL. I added the option for Direct3d11 to plugins.cfg and copied RenderSystem_Direct3D11.dll to the same folder as the demos. I then selected Direct3d11 Rendering Subsystem. I then get the error, :This application has requested the runtime to terminate it in an unusual way"
Is MyGUI compatible with Direct3D11? I could not find where the RenderSystem lib files are included in the project, what do I need to change to use Direct3D11?
I found this error in the Ogre.log:
OGRE EXCEPTION(3:RenderingAPIException): Attempted to render to a D3D11 device without both vertex and fragment shaders there is no fixed pipeline in d3d11 - use the RTSS or write custom shaders. in D3D11RenderSystem::_render at ..\..\..\Ogre 1.9RC2 Download\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp (line 2496).
I have not had success in the past with the RTSS so I will try to use custom shaders. I see that if MyGUI is using DirectX11 directly, that shaders are generated in code in MyGUI_DirectX11RenderManager.cpp but this is not done in MyGUI_OgreRendererManager.cpp
I will attempt to change MyGUI_OgreRendererManager.cpp to include shader generation unless someone has a better solution.
Did you manage to get this working? I just ran into the same problem when trying to get DX11 working.
I've recently integrated MyGUI using both Ogre 2 and D3D11.
I'm very new to MyGUI so I'm not aware of everything, but it seems it doens't create any material and just sets a texture and a renderable to the rendersystem, and let it render.
How is rendered all the various widgets? Theyre all rendered on CPU-side and blitted to a single texture ?
If so, I could modify the OgreRenderManager::doRender to enable a very basic fragment & vertex shader pair.
If there is only one material type to be handled, this could be done very quickly.
MyGUI do not render anything, all output that engine have is geometry (vertex buffers and texture name for each). Then platform render this geometry into given target (usually it is screen, but can be done into texture as well).
Ok, but there is always one single texture per renderable, isn't it ?
/edit: forget my question, I've explored the platform D3D11 files. I'm gonna port it to the Ogre Platform.
Got it working !
I will post the code later this evening or tomorrow
Um, sorry to ask it so late, but have you seen this? viewtopic.php?f=17&t=30366
scrawl is working on Ogre2.0 branch. I'm not sure how far he've got, but you should check it out.
Also best way to send patch is sending pull request at github.
Yes, I've seen that and I'm working from this branch. But even if it's working with Ogre 2, it was only in OpenGL or D3D9, not D3D11.
I'll submit this as a patch on github.