Page 2 of 5

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 2:56 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 3:00 pm
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...

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 3:07 pm
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

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 3:17 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 3:46 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 4:12 pm
by Assaf Raman
We still need to fix the XAML for WP8...

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 4:17 pm
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

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 4:26 pm
by Assaf Raman
Note: I just merged Robert's changes.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 4:44 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 4:49 pm
by Assaf Raman
Can you create a pull request with what you think is best?

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 5:05 pm
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

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 5:05 pm
by Assaf Raman
Done.

Re: Windows8, WinRT, WOA & Metro

Posted: Thu Nov 01, 2012 5:14 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 12:59 am
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 1:04 am
by Assaf Raman
What version of vs2012?

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 1:13 am
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 1:18 am
by Assaf Raman
I am not sure that is his issue.
Can you create a new c++ project in that visual studio?

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 4:25 am
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

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 9:57 am
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 11:08 am
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Fri Nov 02, 2012 12:22 pm
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Sat Nov 03, 2012 1:25 am
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.

Re: Windows8, WinRT, WOA & Metro

Posted: Sat Nov 03, 2012 2:18 am
by Assaf Raman
My latest change broke it. I will check and get it to run. Wait a day.

Re: Windows8, WinRT, WOA & Metro

Posted: Sat Nov 03, 2012 2:45 pm
by Assaf Raman
Almost done, will commit later.

Re: Windows8, WinRT, WOA & Metro

Posted: Sat Nov 03, 2012 5:52 pm
by Assaf Raman
It is working on my computer, committed changes, I will update the "how to" soon, wait for it.