Ogre`s Windows 8 UI Style port (now commited to OGRE!)

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Sun Aug 26, 2012 10:06 pm

Regarding shader compile on WinRT - I found this quote:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
...
The D3dcompiler.lib library requires D3dcompiler_nn.dll. This DLL is not part of Windows 8; it is in the \bin folder of the Windows SDK for Windows 8 along with the Fxc.exe command-line version of the HLSL compiler.

Note While you can use this library and DLL combination for development, you can't deploy Metro style apps that use this combination. Therefore, you must instead compile HLSL shaders before you ship your Metro style app. You can write HLSL compilation binaries to disk, or the compiler can generate headers with static byte arrays that contain the shader blob data. You use the ID3DBlob interface to access the blob data. To develop your Metro style app, call D3DCompile2 or D3DCompileFromFile to compile the raw HLSL source, and then feed the resulting blob data to Direct3D.
...
Meaning - you will never have real-time shader compile on WinRT, they don't allow it, I think the reason is that was the way the hackers hacked the X-Box - so they don't want to risk it.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 9:03 am

Assaf Raman wrote:Meaning - you will never have real-time shader compile on WinRT, they don't allow it, I think the reason is that was the way the hackers hacked the X-Box - so they don't want to risk it.
They say that the reason is unnecessary runtime shader compilation degrade applications launch performance and battery lifetime on mobile devices. Also, modern shader compiler perform shader simulation to profile it and choose the best way to unroll the loops and so on - so the compilation time become unpredictable and there are examples when shader with 3 times nested loop compiles longer than minute due to the simulation process, and it can not be fixed with compilation switches. So to have the freedom to do such things they wants shaders to be compiled at design time.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 9:37 am

Doesn't doesn't like a real reason to me.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 10:05 am

Why not? As developer you already can execute arbitrary unprivileged code, the same does d3dcompiler_nn.dll. You still can load any compiled shaders (baked on developer`s machine) - you don`t need compiler for this. You can even reimplement d3dcompiler_nn.dll by yourself - it could be sandboxed without problems, all that it do is shuffling bytes - without interaction with drivers or any other activity that poses security risks. API that interacts with driver CreateVertexShader(..., void* bytecode, ...) is still available to you as programmer, so you still can pass any trash to it.

On the other hand, there are examples of the shaders that takes several minutes to compile and more than 600MB RAM in process. And WinRT applications has requirement to start in less than 15sec and should transparently restart after being suspended/killed. Moreover, there are only 5 sec to respond to OnSuspending() event or you would be killed without notification, and if OS decides to kill suspended process to free some RAM there would not be notification at all too - so you would be killed and restarted often, and you really should not do at launch anything that could be done ahead of time. It`s mobile friendly world.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 10:42 am

Let the programmer choose how to spend his app CPU, if it take long - I can cache it on the first load, or on a different thread, let me manage my app performance.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 11:02 am

Assaf Raman wrote:Let the programmer choose how to spend his app CPU, if it take long - I can cache it on the first load, or on a different thread, let me manage my app performance.
It`s just not his app CPU anymore :) As there is requirement to prepare to possible unexpected shutdown in 5 sec - no activity should take in worst case more than this, or user data could be lost.

Actually it`s all about power consumption and battery life - it`s the most critical resource in todays world. WinRT applications are fullscreen so that all other could be suspended to save battery life. Apps could be silently killed to free RAM to avoid swapping to save battery life. Automatic hung detection for the same. Special out-of-process facility for most common background tasks like downloading or music playing for the same. It`s not programmer friendly world, but it is user friendly, and probably it`s good.
Last edited by Eugene on Mon Aug 27, 2012 11:13 am, edited 1 time in total.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 11:11 am

On a different topic - did you get to check the feature level 3.1 with your application? Now you can just set the max feature level in the ogre.cfg file.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 11:18 am

Assaf Raman wrote:On a different topic - did you get to check the feature level 3.1 with your application? Now you can just set the max feature level in the ogre.cfg file.
My app uses Ogre`s version lagged behind the tip, as I need something stable (Mac version is selling in App Store right now). So no, I did not checked this, and doubts that we will support something lower than FEATURE_LEVEL_10 (Intel HD 2000/3000 from Sandy Bridge CPU)
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 11:21 am

I don't know what is the feature level for windows phone 8, but rumors are it will be 9.3.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 11:22 am

Assaf Raman wrote:I don't know what is the feature level for windows phone 8, but rumors are it will be 9.3.
Same goes for windows 8 arm.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 12:44 pm

You do plan to release a windows 8 arm version of your product, right?
Did you try to compile OGRE for arm?
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 12:55 pm

Assaf Raman wrote:You do plan to release a windows 8 arm version of your product, right?
Did you try to compile OGRE for arm?
Not yet decided. Our program is not yet suited very well for solely touch interaction, so this should be addressed before even begin thinking about ARM. So ARM is not considered on this iteration. Our world conquering strategy is now focused on WinRT x86. And than, as we already have OSX version, iPad could be more attractive alternative, while WinRT ARM installed base in not high enough.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 1:07 pm

I see what you mean, but you can say the same for the WinRT user base...
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 1:22 pm

Assaf Raman wrote:I see what you mean, but you can say the same for the WinRT user base...
But windows user base is 20 times bigger than Mac, and app store means big sales without big investment into the marketing (checked on Mac). And WinRT x86/x64 user base would grow without doubts. Than, adding ARM support would be one day task, testing and tuning takes one week more.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 1:36 pm

What about a NaCl version? The you will be on Google's store...
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 1:53 pm

Assaf Raman wrote:What about a NaCl version? The you will be on Google's store...
From http://www.netmarketshare.com/browser-m ... pcustomd=0 IE market share is 3x bigger than Chrome. Moreover, Windows market share is 5x bigger than Chrome. And what do you think would happen with Google`s AppStore user base when it start to compete with OS vendor`s AppStore?
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 2:33 pm

Regarding the WinRT build - why don't you build OGRE in static build config?
(I think that on windows phone 8 we will have to static link...)
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 3:38 pm

Assaf Raman wrote:Regarding the WinRT build - why don't you build OGRE in static build config?
(I think that on windows phone 8 we will have to static link...)
We have 6 different configurations (Std, Pro, AppStore Std, AppStore Pro, Branded 1, Branded 2) and several third party libraries (Caelum and various exporters/importers) that depends on Ogre.
Therefore we build Ogre and other dependencies once, and than all those 6 front ends.

Why do you think that Windows 8 would require static linking? It`s no more Windows CE, but normal Windows NT, so no more 32 slots limitation.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 3:45 pm

From what I know about WP8 - you can have DLLs - but you can't dynamically load them, but we will have to wait for the 15th of the month for it to be released - then we will know for sure.
The reason to static link - is that you gain about 10% FPS, and on a phone for such a simple change (dynamic to static) - it is worth it.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 4:34 pm

Forget about static build for WP8 for now - some sources write that you can't have a static lib at all in WP8. :D
0 x
Watch out for my OGRE related tweets here.

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Klaim » Mon Aug 27, 2012 5:25 pm

Assaf Raman wrote:Forget about static build for WP8 for now - some sources write that you can't have a static lib at all in WP8. :D
Quite surprising... do you know the reasons? Limit binary sizes?
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 5:36 pm

I don't have a clue, lets wait for MS to release the WP8 SDK, then bomb their forums with questions...
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Mon Aug 27, 2012 6:06 pm

Assaf, I found issue with pixel formats in D3D11RenderWindowBase::copyContentsToMemory - it is hardcoded to PF_A8B8G8R8 aka DXGI_FORMAT_R8G8B8A8_UNORM, but for WinRT DXGI_FORMAT_B8G8R8A8_UNORM is used by default for Direct2D compatibility, so D3D11Mappings::_getPF(BBDesc.Format) should be used instead. But at the same time D3D11Mappings::_getPF(DXGI_FORMAT format) has many errors in it mainly because DXGI_FORMAT uses LSB to MSB order of bits enumeration instead of MSB to LSB order that is used in D3D9 and Ogre.

Patch is here https://bitbucket.org/eugene_gff/ogre-patches
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Mon Aug 27, 2012 6:38 pm

0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 183
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Tue Sep 04, 2012 3:48 pm

Yet another one issue: for scene_blend alpha_blend alpha components are not blended but cleared to zero, and RGBA render targets are invisible.

Patch is here https://bitbucket.org/eugene_gff/ogre-patches
0 x

Post Reply