[News] Ogre3D now supports Windows Phone 8!
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
I still have some code from Microsoft that I didn't merge - it may be there.
Watch out for my OGRE related tweets here.
-
- Gnoblar
- Posts: 8
- Joined: Wed Nov 07, 2012 11:18 am
Re: [News] Ogre3D now supports Windows Phone 8!
Well baisicly I got an ogre window which is there just for initialization reasons (and which doesn't have a handle to an external window, see below), one scene and one camera in it which is set to render to a shared texture (I had to modify ogre a bit for this as well, see below). Then I took the SinbadCharacterController, added the character to the scene, and call addTime method every frame (I use the PhoneXamlDirect3D template structure, but that shouldn't matter). Then after the SinbadCharacterController->addTime call, I also call myRenderTexture-update() every frame. Everything else gets rendered to the texture correctly, but animations only started to play after I changed the myRenderTexture-update() to Ogre::Root::getSingleton().renderOneFrame(timeDelta). Until that, attempts to play an animation only changed the character pose (I think to what it should be at the end of the animation).Assaf Raman wrote:How can I recreate your issue?
So, to the modifications that I had to make to Ogre and which I would like to suggest to be added to the codebase. These are from the notes I've written for my team, so ignore the format of the language

1. Creating an Ogre window is required to initialize some components of Ogre and currently (D3D11) createRenderWindow throws an exception if you don't pass an externalWindowHandle as miscParam. However, as CoreWindow doesn't seem to exist in a PhoneXamlDirect3D app (?), we can't pass the handle to the Ogre::ROOT->createRenderWindow. As To overcome this we need to modify the createRenderWindoe method to allow creating the window without the handle.
- Modify the code to ignore externalWindowHandle stuff in the method if the handle is not given.
2. It seems that ogre has a bug(?) which makes it create a texture with DXGI_FORMAT_R8G8B8A8_UNORM (instead of DXGI_FORMAT_B8G8R8A8_UNORM) even if Ogre::PF_B8G8R8A8 is given to Ogre::TextureManager::createManual. As DXGI_FORMAT_R8G8B8A8_UNORM can not be a shared texture, we need to add a fix to make ogre greate the texture in right format:
- Add "case PF_B8G8R8A8: return DXGI_FORMAT_B8G8R8A8_UNORM;" to the switch in DXGI_FORMAT D3D11Mappings::_getPF(PixelFormat ogrePF)
3. It also seems that ogre doesn't support creating textures with the misc flags D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX and D3D11_RESOURCE_MISC_SHARED_NTHANDLE which we need for the shared texture. Easiest way to fix this is the following hack [sensured

-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
Can you fork OGRE, fix the code (really fix, not hack it) - then ask for a pull request? This will be the easiest way to get it into OGRE code repo.
Watch out for my OGRE related tweets here.
-
- Kobold
- Posts: 27
- Joined: Mon Sep 27, 2004 5:44 pm
- x 2
Re: [News] Ogre3D now supports Windows Phone 8!
Or you could help out the Axiom project to provide a mostly managed solution.Zonder wrote:help the mogre people then you get your managed enviroment. but that depends if windows phone has clrOenone575 wrote:Will there be a C# wrapper or other managed C# interface for the WP8 version of Ogre3D?
The loss of XNA with no inbuilt C# alternative is a real shame in my opinion. Hopefully we'll have MonoGame available for WP8 soon, but it would be great to have other alternatives too and Ogre3D is one that would be superb to have.
Axiom 3D - .Net 3D Rendering Engine
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: [News] Ogre3D now supports Windows Phone 8!
Great news!
And especially that they contacted us.
And especially that they contacted us.

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Kobold
- Posts: 35
- Joined: Wed Aug 18, 2010 9:14 am
Re: [News] Ogre3D now supports Windows Phone 8!
i want create my scene, but there was some HLSLProgram not found in mMicrocodeCache. how can i do it?
some codes as follows:
Ogre::MaterialPtr pMat = Ogre::MaterialManager::getSingleton().create("TextMat",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
pMat->getTechnique(0)->getPass(0)->createTextureUnitState( "BumpyMetal.jpg" );
patchEntity->setMaterialName("TextMat");
Ogre::Pass* patchPass;
patchPass = pMat->getTechnique(0)->getPass(0);
some codes as follows:
Ogre::MaterialPtr pMat = Ogre::MaterialManager::getSingleton().create("TextMat",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
pMat->getTechnique(0)->getPass(0)->createTextureUnitState( "BumpyMetal.jpg" );
patchEntity->setMaterialName("TextMat");
Ogre::Pass* patchPass;
patchPass = pMat->getTechnique(0)->getPass(0);
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
wp8 doesn't have a shader compiler, you have to build a shader cache using the winRT version of your project.
Watch out for my OGRE related tweets here.
-
- Kobold
- Posts: 35
- Joined: Wed Aug 18, 2010 9:14 am
Re: [News] Ogre3D now supports Windows Phone 8!
thx!
i can not found where and when the cache was created. can you tell me it?
i can not found where and when the cache was created. can you tell me it?

-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
Read BuildingOgreWindowsPhone.txt - all the info is there.
Watch out for my OGRE related tweets here.
-
- Kobold
- Posts: 35
- Joined: Wed Aug 18, 2010 9:14 am
Re: [News] Ogre3D now supports Windows Phone 8!
hi, i got a new problem. first , I remove all shader cache files exsited on my computer. the next , i compile and run winRT project , but the shader cache files were not created on my computer. there was any problem with my operating.
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
BuildingOgreWindowsPhone.txt
so -27. Before you run for the first time make sure you have a shader cache for the project you are running - as you can't compile shader on the phone. (TODO - explain more)
28. In Windows Phone and (Store versions of WinRT) you don't have the shader compiler, meaning you have to use the shader cache, they tricky part is that you need to create the shader cache, to do that, compile OGRE for WinRT and add ENABLE_SHADERS_CACHE_SAVE to the preprocessor definitions in the config, run the project, act out all the use cases you are going to do in the final version, then go to the home directory of the WinRT (I find the home directory by putting a breakpoint in FileSystemLayerImpl_WIN32.cpp line 138) and copy the file cache.bin from the OGRE dir there to Samples\Browser\WinRT.
compile OGRE for WinRT and add ENABLE_SHADERS_CACHE_SAVE
I find the home directory by putting a breakpoint in FileSystemLayerImpl_WIN32.cpp line 138
Watch out for my OGRE related tweets here.
-
- Kobold
- Posts: 35
- Joined: Wed Aug 18, 2010 9:14 am
Re: [News] Ogre3D now supports Windows Phone 8!
thx to your response! i had solved it . there was error for my operating. the shader cache files was created must click "Quit" button in game when run the winRT project . i click the stop debugging button everytime. thanks to you.Assaf Raman wrote:BuildingOgreWindowsPhone.txtso -27. Before you run for the first time make sure you have a shader cache for the project you are running - as you can't compile shader on the phone. (TODO - explain more)
28. In Windows Phone and (Store versions of WinRT) you don't have the shader compiler, meaning you have to use the shader cache, they tricky part is that you need to create the shader cache, to do that, compile OGRE for WinRT and add ENABLE_SHADERS_CACHE_SAVE to the preprocessor definitions in the config, run the project, act out all the use cases you are going to do in the final version, then go to the home directory of the WinRT (I find the home directory by putting a breakpoint in FileSystemLayerImpl_WIN32.cpp line 138) and copy the file cache.bin from the OGRE dir there to Samples\Browser\WinRT.compile OGRE for WinRT and add ENABLE_SHADERS_CACHE_SAVEI find the home directory by putting a breakpoint in FileSystemLayerImpl_WIN32.cpp line 138

-
- Gremlin
- Posts: 173
- Joined: Sun Jun 06, 2010 4:34 pm
Re: [News] Ogre3D now supports Windows Phone 8!
i got error to build the windows phone 8 , any suggestion ?
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=76347
Code: Select all
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(389): error C2065: 'D3DCOMPILE_DEBUG' : undeclared identifier
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(392): error C2065: 'D3DCOMPILE_SKIP_OPTIMIZATION' : undeclared identifier
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(399): error C2065: 'D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR' : undeclared identifier
1>j:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(403): error C2065: 'D3DCOMPILE_PACK_MATRIX_ROW_MAJOR' : undeclared identifier
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(408): error C2065: 'D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY' : undeclared identifier
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(416): error C3861: 'D3DCompile': identifier not found
1>J:\graphic\ogre1.9\RenderSystems\Direct3D11\src/OgreD3D11HLSLProgram.cpp(463): error C3861: 'D3DReflect': identifier not found
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
How did you build? where did you get the source from?
Watch out for my OGRE related tweets here.
-
- Gremlin
- Posts: 173
- Joined: Sun Jun 06, 2010 4:34 pm
Re: [News] Ogre3D now supports Windows Phone 8!
from "hg clone https://bitbucket.org/sinbad/ogre" v1-9
following the BuildingOgreWindowsPhone.txt in the source dir.
following the BuildingOgreWindowsPhone.txt in the source dir.
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
Try this - should be easier for you.
Assaf Raman wrote:A ready to go WinRT and WP8 solution.
1. Install Window 8 and run it.
2. Install Windows Phone 8 SDK
3. Install Visual Studio Express 2012 for Windows 8
4. Download and uzip this to c: root. (The result will be in C:\1.9WPRC)
5. If you want to compile for Windows Phone 8 - open this solution - C:\1.9WPRC\WP8\build\OGRE.sln using Visual Studio Express 2012 for Windows Phone 8
6. If you want to compile for WinRT - open this solution - C:\1.9WPRC\WinRT\build\OGRE.sln using Visual Studio Express 2012 for Windows 8
I didn't try to build with to paid version of Visual Studio because I wanted to use only free tools (except Windows 8 I guess).
Make sure to use the right Visual Studio versions (as in steps 5,6) - else you won't be able to deploy the app (deploy will fail without any error message to explain why).
Watch out for my OGRE related tweets here.
-
- Gnoblar
- Posts: 22
- Joined: Wed Dec 25, 2013 4:06 am
- x 1
Re: [News] Ogre3D now supports Windows Phone 8!
Is it possible to create Windows Phone Direct3D + XAML project with Ogre 1.9? Native Direct3D is working, but I can't access services like advertisement, IAP etc. Also rotating to landscape is very problematic.
WinRT version has sample browser D3D+XAML implementation, is the same possible for WinPhone?
WinRT version has sample browser D3D+XAML implementation, is the same possible for WinPhone?
Check out my Ogre based mobile games: Pig Shooter 3D, Bubble Shooter 3D, Space Rush 3D
Github: https://github.com/RMDarth
Github: https://github.com/RMDarth
-
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: [News] Ogre3D now supports Windows Phone 8!
It has been a long time since I was working on this.
Try it out - shouldn't be that hard to get working.
Try it out - shouldn't be that hard to get working.
Watch out for my OGRE related tweets here.