Windows8, WinRT, WOA & Metro

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.
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: Windows8, WinRT, WOA & Metro

Post by robert_sasu »

This is the first push of this code: https://bitbucket.org/sinbad/ogre/chang ... 8ac7ecdab0

This was fixed by the https://bitbucket.org/sinbad/ogre/chang ... 94f0117959 patch from Microsoft Open Technologies, Inc. I also fixed this code on my own repo.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

robert - can you fork in bitbucket, do all your fixes then ask for a pull request of the new repo in bitbucket?
I am not next to the code computer now and it will be easier for me to merge...
Watch out for my OGRE related tweets here.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

Assaf Raman wrote:I see, Eugene - can you explain the fix you made to src\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp ?
It`s required when you use render target with ARGB format rather than XRGB - otherwise alpha would be always zero and rendered picture totally transparent. This feature is usefull and used by us, but may be it should be restricted to some feature levels or render target format should be checked before enabling alpha blending
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: Windows8, WinRT, WOA & Metro

Post by robert_sasu »

I have created the pull request from my new repo. But after reading the last post I think it should be done otherwise, but do not want to hack it.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

Assaf Raman wrote:BTW: Do you plan to have a windows phone 8 version of your product?
It`s quite possible. Win8, WP8 and XBox720 all use D3D11+XAML and almost identical API subset.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

We still need to fix the XAML for WP8...
Watch out for my OGRE related tweets here.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

robert_sasu wrote:I have created the pull request from my new repo. But after reading the last post I think it should be done otherwise, but do not want to hack it.
From D3D9 RS:

Code: Select all

__SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE)
__SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE)
<...>
__SetRenderState(D3DRS_BLENDOP, D3D9Mappings::get(op))
__SetRenderState(D3DRS_BLENDOPALPHA, D3D9Mappings::get(op))
From docs

Code: Select all

When D3DRS_SEPARATEALPHABLENDENABLE is set to FALSE (which is the default condition), the render-target blending factors and operations applied to alpha are the same as those defined for blending color channels.
So it`s the way it intended to work.
Can you explain what type of error do you have with particle sample? Is it crash or wrong rendering? Can you provide crashlog or screenshot?

P.S.
I still work on WP8 changes
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

Note: I just merged Robert's changes.
Watch out for my OGRE related tweets here.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

Assaf Raman wrote:Note: I just merged Robert's changes.
You broke alpha blending not only for A but for RGB too. Nobody set mBlendDesc.RenderTarget[0].DestBlend & SrcBlend factors now and mBlendDesc.AlphaToCoverageEnable that was disabled for low feature levels is enabled now. I propose to rollback this change as Robert agreed with my argumentation about ARGB blending and it is so in D3D9 RS too. Problem with particle effects sample is not here, and should be investigated.

Some amount of crashes on x64 were due to the casting pointers to long (sizeof(long) == 4 on Win64 )and vice versa and are fixed in my original patch. Seems that Robert worked on branch where those problems were not yet fixed.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

Can you create a pull request with what you think is best?
Watch out for my OGRE related tweets here.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

Assaf Raman wrote:Can you create a pull request with what you think is best?
https://bitbucket.org/sinbad/ogre/pull- ... alpha/diff
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

Done.
Watch out for my OGRE related tweets here.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

I think it`s possible to simplify dependencies include/lib paths management for WinRT projects that are not generated by CMake by using custom *.props files that are generated by CMake from templates with substituted actual paths to dependencies, source and build folders, and <Import...>-ing them into the *.vcxproj file. Will do this tomorrow, and than will look at particle sample.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: Windows8, WinRT, WOA & Metro

Post by KungFooMasta »

Are the .vcxproj files able to be loaded in Win8 using VS2012 right now? I am not able to do this.

I am following the instructions in BuildingOgreWinRT.txt, but I cannot run step 8 of those instructions.

Here is what I've done:

1. Clone repository: https://bitbucket.org/eugene_gff/ogre-d ... cies-winrt (Store locally: E:\misc\ogre-dependencies-winrt)
2. Build OgreDependencies.VS2012.WinRT.sln in debug/release
3. Clone repository: https://bitbucket.org/sinbad/ogre/overview (Store locally: E:\misc\ogre)
4. Open CMake GUI (v2.8.9), set source (E:\misc\ogre) and binary (E:\misc\ogre\bin) output paths. Press configure, get red errors
5. Enter the following data: OGRE_DEPENDENCIES_DIR E:\misc\ogre-dependencies-winrt
6. Press Configure
7. More entries appear, and you can select which plugins to build, etc.
8. Press Configure. No Errors
9. Press Generate.
10. Open "Ogre.sln" from binary output path. (E:\misc\ogre\bin\OGRE.sln)

At step 10 Visual Studio gives me an error when trying to load each project: "The 'Visual C++ Package' package did not load correctly.". I have re-installed Visual Studio 2012 Professional with all options and additionally installed Win8 SDK, but the same problem appears. I cannot load any of the generated solutions or vcxproj files.
Creator of QuickGUI!
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

What version of vs2012?
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
x 56
Contact:

Re: Windows8, WinRT, WOA & Metro

Post by Klaim »

Maybe try the new CMake 2.8.10 version? They didn't put the news on the website yet but it's downloadable now (release version, not RC anymore): http://www.cmake.org/cmake/resources/software.html
There are apparently fixes for the VS 2012 generators.

I didn't try it and I'm working with Win7 anyway so you'll have to try it yourself.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

I am not sure that is his issue.
Can you create a new c++ project in that visual studio?
Watch out for my OGRE related tweets here.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: Windows8, WinRT, WOA & Metro

Post by KungFooMasta »

Yes, I've been working on a project created using the "Windows Store Direct3D App" using Visual C++.
(I've been able to build/use Bullet Physics in C++ in this application)

I installed CMake 2.8.10 and I was able to load OGRE.sln on my home machine. Thanks for pointing that out Klaim!

(On my home machine) The version of Visual Studio Ultimate 2012 is listed as:
Version 11.0.50727.1 RTMREL
Creator of QuickGUI!
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: Windows8, WinRT, WOA & Metro

Post by robert_sasu »

Yesterday I created my pull request just before Eugene posted. In the weekend I update my code to the latest one, and try to do some bugfix. I will try to force the team here at my job to migrate to 1.9 and DirectX 11 before the final release, so as I will be able to work more on Ogre.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Windows8, WinRT, WOA & Metro

Post by Eugene »

Eugene wrote:
Assaf Raman wrote:I see, Eugene - can you explain the fix you made to src\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp ?
It`s required when you use render target with ARGB format rather than XRGB - otherwise alpha would be always zero and rendered picture totally transparent. This feature is usefull and used by us, but may be it should be restricted to some feature levels or render target format should be checked before enabling alpha blending

Code: Select all

Changeset: 3998 (43b8e9a9516d) D3D11 RS - fixed one more alpha blend issue
Branch:  v1-9 
User: Assaf Raman<assaf@assaf.co.il>
Date: 2012-11-02 00:47:48 +0200 (11 hours)
Nice fix, Assaf :) NVidia drivers are so forgiving that I didn`t see this issue.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

Did you see my software mipmap hack commit, god... the old feature profiles are very very buggy if you don't run on WinRT.
Watch out for my OGRE related tweets here.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: Windows8, WinRT, WOA & Metro

Post by KungFooMasta »

I see there is a "SampleBrowserWinRT.vcxproj" file in the depot. (Samples\Browser\WinRT) Is anybody able to build/run that project? When I try to build the project I get an error saying "The project file ' ' has been renamed or is no longer in the solution". A very odd error.

I'm having problems using Ogre in my WinRT app. Its frustrating because I'm able to build Ogre, include it in my "Windows Runtime Component" project (I only try to create OgreRoot), and build it without errors, but when I try to run my app I get some COM exception when trying to create my Game class. The exception has no information, the call stack points to my Game constructor, but I can't even step into the constructor without generating an exception.

We should aim to have 2 samples of Ogre in a WinRT app:
1. A Windows Store Direct3D App project that uses Ogre directly.
2. A Windows Store Direct3D App that uses a Windows Runtime Component that uses Ogre.
Creator of QuickGUI!
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

My latest change broke it. I will check and get it to run. Wait a day.
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
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

Almost done, will commit later.
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
x 76

Re: Windows8, WinRT, WOA & Metro

Post by Assaf Raman »

It is working on my computer, committed changes, I will update the "how to" soon, wait for it.
Watch out for my OGRE related tweets here.
Post Reply