DirectX 11 render system - work-in-progress

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
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Not done yet with the merge, but getting there.

Here is the code backup:Direct3D10_pre10.zip

I didn't finish the render function because I want to rewrite the fixed func use.
I will use the exact same shader as in the DX 10 sample, and I will write the code that auto generate the input by the vertex declaration.

I merged most of my code with Sinbad code. I hope to be done with the merge tomorrow so we can update the CVS.

I added something nice to the code today, I created a class to wrap the ID3D10Device interface and I implemented the "->" operator, so I could replace all the ID3D10Device data members with the new ID3D10Device wrapper (called D3D10Device). So – now I can clean the ID3D10InfoQueue before every ID3D10Device call, and so – I can have the error string for ID3D10Device errors, this helps a lot with the debugging. I will add tests and exceptions after every ID3D10Device call. In dx10 there are a lot of the ID3D10Device calls that don't return an HResult value (like VSSetShader and such), so this will be the only way to see if there are errors, so now I won't need to "clear the error log" before every ID3D10Device use, the new class does it for me.
Watch out for my OGRE related tweets here.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Awesome, thanks Assaf.
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

Post by Assaf Raman »

Done with the merge.

Here is the code backup:Direct3D10_pre11.zip

I can't see anything. This is debug time.

I did the base for the fixedFunc, we will need to do it better after we see something.

Sinbad - I think you can review and check-in to the CVS.
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

Post by Assaf Raman »

I am going to work on this more today - so - you can wait with the review.
Watch out for my OGRE related tweets here.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

I'm willing just to give you access to CVS so you can do the work there - the history will be available should anything accidentally get lost in the merge anyway.

I just need a contributor license agreement with a record of your Sourceforge account.
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

Post by Assaf Raman »

Added error checks to most device calls.

Renamed all the D3D10device data members to be called mDevice.

Added error description to the output of all the exceptions so now we can see the error descriptions in the log and also have exceptions for device methods without a return code.

I don't know why some of the device methods don't have an error code – but it seems that my method of discovering errors work quite well.

In the future I will add more options in the render system commands – so we will be able to turn on log based error detection in release by selecting an option, and possibly add a parameter to define the error level for the exceptions.

Here is the code backup:Direct3D10_pre12.zip

Now I will try to work on getting the render system to render something – I will compare the version I have that renders to the merged version.
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

Post by Assaf Raman »

I got it to render - I will post the code later today.

The problem was that in my fixFunc vertex shader creator I analyzed the vertex declaration and created the shader input struct by the declaration, for position I created a float3 parameter instead of a float4 that seems to be needed. So I fixed it so the position will always be float4.
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

Post by Assaf Raman »

OK, I am rendering.

Added a parameter named "Information Queue Exceptions Bottom Level" to the options - to control the level of dx10 information queue messages that will cause an exception.

Also solved some bugs with the memory buffers and the fixedFunc.

I think this is the time to update the CVS with this code.

The following OGRE demos seem to work with this code without change to the demo code: Demo_ParticleFX, Demo_BezierPatch, Demo_FacialAnimation.
I guess other demos work also – I didn't test them all.

Here is the code:Direct3D10_pre13.zip

The license for the code is the same as the OGRE license and I already signed the OGRE contributor forum and sent it to Sinbad (years ago :) ).
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

Post by Assaf Raman »

I just resent you the contributor license agreement and the source forge user name (assaframan).
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

Post by Assaf Raman »

The CVS is updated with the latest code.
From now on - I will commit my changes to the CVS and will not post any more source code in this thread.

I will keep you posted with this thread.
Watch out for my OGRE related tweets here.
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3

Post by CaseyB »

When will we get to see another showcase post? I don't have Vista so I only get to drool over the screen shots!
Image
Image
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

Post by Assaf Raman »

Well, I guess the next showcase will be render to texture or lights and fog with the fixedFunc emulation. I don't know yet when this will be.
Watch out for my OGRE related tweets here.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Great, thanks for committing to CVS, it's looking fine. I'm still spread way too thin at the moment but I'm hoping I'm going to get some more time for this soon, perhaps next month.
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

Post by Assaf Raman »

I am going to work on this more this weekend. I will update you when I will have results.
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

Post by Assaf Raman »

DX10 doesn't support assembly shaders - so it doesn't support the cg compiler that compiles cg to assembly, so - in order to solve this the solution is to compile cg as hlsl, the languages are almost the same so - it will work in a lot of the cases.
Also – if the cg plugin registers – it starts to compile shaders and to create assembly shaders that we don't want. So – I made a little patch that unregister the cg plugin factory and register the DX10 hlsl factory instead.
That is the best choice I can see for now.

I also fixed the world matrix in the render system to work.

I added lighting enabled parameter to the fixedFunc.

I added a basic texture matrix transform to the fixedFunc.

I worked more on the render to texture and got the related code to a better state.

Now a lot more of the demos work.

Latest code is in the cvs head.

If anyone wants screenshots – post a replay and I will add some to the showcase thread.
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

Post by KungFooMasta »

Screenshots are always nice to look at! :twisted:
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

Post by Assaf Raman »

Ok, tomorrow I will get the "take screenshot" working for the DX10 render system and post a screenshot of each of the running demos – so you will be able to see the status of the project.
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

Post by Assaf Raman »

I kept having problems with TortoiseCVS and vista – TortoisePlink.exe creases when I try to update or commit, the problem only occurs when I access the cvs in secure mode (ext). So – I downloaded the TortoiseCVS code, compiled and debug, and it seems the crash was because of a string formatting code of a failed access attempt to the cvs, so I fixed the problem and now it doesn't crash when I access the cvs and can't get access, it just writes – " cvs commit: warning: unrecognized response `Access denied' from cvs server" a few times.

It seems that from time to time the secure access is too busy or something so my access is denied, after a few attempts or after some time passes I do have access.

If any of you have this problem with the crash here is my fixed TortoisePlink.exe that you can just copy to your TortoiseCVS install directory instead of the existing file. You will still get the "access denied" – but no crash.

I am posting this message here because the only secure cvs commit I am currently doing is to the OGRE DX10 render system, and the "access denied" is bugging me like hell. :evil:
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

Post by Assaf Raman »

Now you can take screenshots.
The latest code is in the cvs and the latest screenshots are in the showcase thread of this project.
Watch out for my OGRE related tweets here.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Assaf Raman wrote:I kept having problems with TortoiseCVS and vista – TortoisePlink.exe creases when I try to update or commit,
Weird, I'm using Tortoise on Vista and I haven't noticed this problem - all I have noticed is that Visual Studio 2005 crashes an awful lot when doing batch builds, which is very annoying. Are you on the 64-bit version or 32-bit?
User avatar
bibiteinfo
Gremlin
Posts: 197
Joined: Wed Apr 12, 2006 2:48 pm
Location: Montreal, Canada

Post by bibiteinfo »

I've got the exact same problem with TortoiseCVS under vista 64 bits and I didn't find a solution yet.
Image
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

Post by Assaf Raman »

I am using vista 32 bits. bibiteinfo - can you give more info on your problem?
Watch out for my OGRE related tweets here.
User avatar
bibiteinfo
Gremlin
Posts: 197
Joined: Wed Apr 12, 2006 2:48 pm
Location: Montreal, Canada

Post by bibiteinfo »

I can do a CVS checkout and then whenever I do CVS update with Tortoise, I'm getting the TortoisePlink.exe stopped working window. I see the update window, but it never ask me my password. It happen in ext ssh mode, I don't know if this has a link or not.

The bug report is here : http://sourceforge.net/tracker/index.ph ... tid=451972
Image
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

Post by Assaf Raman »

Bad news, we won't be able to use cg as hlsl, more over, we won't be able to use any type of shader with the DX10 system except hlsl shader model 4.
I couldn't get older shader to work (they compile but CreateVertexShader and CreatePixelShader doesn't return a shader object for the ID3D10Blob I got from the compile.)

I rechecked and it seem they dropped the support for older shader models.
Look for the help topic "D3D10CompileShader" in the directx_sdk.chm that comes with the latest dx sdk, and you will find this quote:
The Direct3D 10 currently supports only "vs_4_0", "ps_4_0", and "gs_4_0".

I will remove the cg as hlsl support I just added.
Watch out for my OGRE related tweets here.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8

Post by haffax »

Is Cg so different from SM 4.0 that it can't be compiled to it?
team-pantheon programmer
creators of Rastullahs Lockenpracht