Direct3D11 Testing

Materials, textures, lighting, postfx
• 1
• 2

Direct3D11 Testing

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
Hey Everyone,

As Jeff mentioned in the 3.8 release thread, i have been working on getting the awesome work anis started here https://github.com/Lopuska/Torque3D/tre ... 3D11_R%26D up and running. I have fixed a lot of problems, fixed a few performance problems and converted all shaders in the common shader folder to use a new helper macro system to enable Direct3D9 and 11 shaders to place nice together (see post below).

It's coming along well and while i wanted to fix a few more things before starting this thread, time has forced my hand. So don't expect it to be full production quality and ready yet, it's not. It's all a work in progress.

Source Code:
https://github.com/rextimmy/Torque3D/tree/d3d11

Problems i know about:
• Glow blur problem
• No instancing support yet
• Windowed mode and editor toggle. See here
• Feature levels not properly implemented yet
Due to the sheer amount of shaders that need switching over to the helper macro system (this does not include shadergen shaders however), without a shadow of doubt i have missed something somewhere. One thing you will notice compared to D3D9 is the dramatic drop in memory usage and a faster loading of levels.

There is one performance problem i am aware of involving the constant buffers, long story short i can fix this using 11.1 feature level but unfortunately this is only for Window 8 or above. This is one area i need to really fix up and i will when i get the time. So for now i'm not concerned about performance but rather getting it all working and than i will go and start profiling it in detail and fixing up any performance issues.

Compiling

If you are using Windows 10 and want to run in debug mode you must have the graphics tools installed. The easy way to do this via an admin command prompt

Code: Select all

Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0
Unfortunately the old D3D9 is still using the deprecated Microsoft DirectX SDK. This will cause a lot of warnings when you compile and it will fail to compile with VS 2015 due to the use of dxerr . I will fix this up in time but for now i wanted to keep the fully working and 100% tested D3D9 device in place until D3D11 is 100% working.

If you use CMake the D3D11 code will be automatically included and if you use the project manager you will have to select "Direct3D 11 Rendering". I have also included VS 2013 to the project generator.

It would be great if people could start testing this out and reporting problems, there will be more than what i listed above. Please only use the full template, the empty template has not been updated.

Last edited by Timmy on Fri Jan 08, 2016 7:36 am, edited 7 times in total.

Re: Direct3D11

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
*Reserved for shader tutorial.

Re: Direct3D11

RichardM
Posts: 32
Joined: Tue Feb 10, 2015 10:23 pm

Great job, I will see if I can make some time to test it.

Re: Direct3D11

J0linar
Posts: 46
Joined: Thu Feb 05, 2015 8:50 pm
Built with vs2010 using cmake

Crash:
GFXD3D11Device::init - D3D11CreateDeviceAndSwapChain failed!

My Specs:
Windows 8.1
i7-3630QM CPU @ 2.40GHz 2.40GHz
64 Bit
16GB Ram

GFX: Nividia GeForce GTX 675M

Re: Direct3D11

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
I gotta admit i haven't tried it with VS 2010. Was that in debug or release mode? If you get that in debug mode you have to install the Windows Software Development Kit for Win8

Re: Direct3D11

J0linar
Posts: 46
Joined: Thu Feb 05, 2015 8:50 pm
soz was late here,
it was in debug and i have the Dev kit for Win8 installed

Re: Direct3D11

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
Is VS 2010 definitely finding/using that windows kit directory? You can remove this line if you like https://github.com/rextimmy/Torque3D/bl ... e.cpp#L271 it will work than (should do anyway)

If you are not seeing heaps of these type of warning messages than it's not using the windows kit

Code: Select all

warning C4005: 'D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD' : macro redefinition (C:\Devel\Torque3D-rex-d3d11\Engine\source\gfx\D3D11\gfxD3D11VertexBuffer.cpp) 

Re: Direct3D11

TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
@
Timmy
- Wanted to post just to say thanks a lot for tackling this. I look forward to seeing this completed!

Re: Direct3D11

Dwarf King
Posts: 186
Joined: Thu Feb 05, 2015 7:20 pm
You are the best @
Timmy

Re: Direct3D11 Testing

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
Thought i would post and let everyone know i haven't forgotten nor given up on the D3D11 code.

Anyway it was brought to my attention a few people where having trouble running the code in debug mode. I placed a fix on my repo for this, so if you had this problem before it should be ok now.

So in short the debug layers is not essential anymore to run in debug mode but if you do want the extra information this provides you need to

Windows 7: Have at least Windows 8.0 SDK installed
Windows 10: Have graphics tools installed. See my OP for details.

I have started work on the instancing which is the last big feature to add. I have put this in a separate branch until it is finished and than i will merge it over to my main D3D11 branch. If you happen to checkout the d3d11_instancing branch just beware it might not be stable or even work at all, best to stick to the main D3D11.

Once instancing is done it's time to fix some of the smaller issues and start cranking out a bit more performance

I will write the shader tutorial tonight, i totally forgot about it
• 1
• 2

Who is online

Users browsing this forum: No registered users and 7 guests