Pre-Pull Request: D3D11 Initial testing

This forum is for tracking and working on active issues that need to be resolved, as well as testing Pull Requests that are waiting to be integrated into Torque 3D.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 7
64 posts Page 1 of 7
JeffR
Steering Committee
Steering Committee
Posts: 750
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Sat Dec 12, 2015 7:06 am
While not a full PR yet, the D3D11 stuff looks stable enough we can being preliminary testing of how it plays for everyone.

The branch is here: https://github.com/rextimmy/Torque3D/tree/d3d11

Follow the standard 'how to test a PR' instructions to pull it down to your local repository an make sure you do a new project to ensure the new engine and template files get copied. Once you get the game fired up, ensure you can switch to the D3D11 driver in the options menu and test everything and make note of any problems.

If you can integrate it into an existing project for a more in-depth test, that's even better.
Dwarf King
Posts: 156
Joined: Thu Feb 05, 2015 7:20 pm
by Dwarf King » Mon Dec 14, 2015 12:05 pm
JeffR wrote:If you can integrate it into an existing project for a more in-depth test, that's even better.


I am not sure that would be possible as I use AFX 2.0 with UAIK in my project. I mean AFX 2.0 uses DX 9 shaders as far as I know and DX 11 does not fall back to DX 9 shaders right?

Anyway I will try to see the outcome after some testings :D And report back with the results :mrgreen:
Azaezel
Posts: 383
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Tue Dec 15, 2015 5:46 am
Dwarf King wrote:
JeffR wrote:If you can integrate it into an existing project for a more in-depth test, that's even better.


I am not sure that would be possible as I use AFX 2.0 with UAIK in my project. I mean AFX 2.0 uses DX 9 shaders as far as I know and DX 11 does not fall back to DX 9 shaders right?

Anyway I will try to see the outcome after some testings :D And report back with the results :mrgreen:


Actually, Timmy threw in some macros to allow dx9 and dx11 to share shaders. for some practical samples:
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L31 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L32

https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L35 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L32

https://github.com/rextimmy/Torque3D/bl ... sl#L41-L67 becomes
https://github.com/rextimmy/Torque3D/bl ... sl#L39-L59 (Do note best kept in groups of 4, so 3+1, 2+2, 4)

https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L70 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L62

https://github.com/rextimmy/Torque3D/bl ... .hlsl#L178 becomes
https://github.com/rextimmy/Torque3D/bl ... .hlsl#L170 on the send end with
https://github.com/rextimmy/Torque3D/bl ... w.hlsl#L75 becoming
https://github.com/rextimmy/Torque3D/bl ... w.hlsl#L76 on the recieving end,
RasterRon
Posts: 53
Joined: Sun Oct 25, 2015 7:36 am
 
by RasterRon » Tue Dec 15, 2015 5:54 am
JeffR wrote:While not a full PR yet, the D3D11 stuff looks stable enough we can being preliminary testing of how it plays for everyone.

The branch is here: https://github.com/rextimmy/Torque3D/tree/d3d11

Follow the standard 'how to test a PR' instructions to pull it down to your local repository an make sure you do a new project to ensure the new engine and template files get copied. Once you get the game fired up, ensure you can switch to the D3D11 driver in the options menu and test everything and make note of any problems.

If you can integrate it into an existing project for a more in-depth test, that's even better.


Works great so far and with the switch options. :)
RasterRon
Posts: 53
Joined: Sun Oct 25, 2015 7:36 am
 
by RasterRon » Tue Dec 15, 2015 6:10 am
One small issue that I did notice is when you are in Windowed Mode (Maximize) and toggled the World Editor on and back to the game, the maximize capability is no longer there. This does not happen in DX9.
Dwarf King
Posts: 156
Joined: Thu Feb 05, 2015 7:20 pm
by Dwarf King » Tue Dec 15, 2015 3:05 pm
Azaezel wrote:
Dwarf King wrote:
JeffR wrote:If you can integrate it into an existing project for a more in-depth test, that's even better.


I am not sure that would be possible as I use AFX 2.0 with UAIK in my project. I mean AFX 2.0 uses DX 9 shaders as far as I know and DX 11 does not fall back to DX 9 shaders right?

Anyway I will try to see the outcome after some testings :D And report back with the results :mrgreen:


Actually, Timmy threw in some macros to allow dx9 and dx11 to share shaders. for some practical samples:
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L31 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L32

https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L35 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L32

https://github.com/rextimmy/Torque3D/bl ... sl#L41-L67 becomes
https://github.com/rextimmy/Torque3D/bl ... sl#L39-L59 (Do note best kept in groups of 4, so 3+1, 2+2, 4)

https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L70 becomes
https://github.com/rextimmy/Torque3D/bl ... P.hlsl#L62

https://github.com/rextimmy/Torque3D/bl ... .hlsl#L178 becomes
https://github.com/rextimmy/Torque3D/bl ... .hlsl#L170 on the send end with
https://github.com/rextimmy/Torque3D/bl ... w.hlsl#L75 becoming
https://github.com/rextimmy/Torque3D/bl ... w.hlsl#L76 on the recieving end,


That is some awesome work done their! :D
Mud-H
Posts: 175
Joined: Thu Feb 19, 2015 3:08 pm
by Mud-H » Tue Jan 12, 2016 8:23 am
I'm trying to solve an issue I'm having with SkyBox/SkyLine with the PBRDX11 branch and I found something which look not correct in the new shaders. I'm really not an expert in shaders but I'm starting to understand a little more how they work.

In shaders/common/planarReflectV.hlsl there's this:

Code: Select all

TORQUE_UNIFORM_SAMPLER2D(texMap, 0);
TORQUE_UNIFORM_SAMPLER2D(refractMap, 0);

I don't think this is ok, right?
From the torqueScript shader, it's set like this:

Code: Select all

new ShaderData( Reflect )
{
   DXVertexShaderFile    = "shaders/common/planarReflectV.hlsl";
   DXPixelShaderFile    = "shaders/common/planarReflectP.hlsl";
   
   OGLVertexShaderFile  = "shaders/common/gl/planarReflectV.glsl";
   OGLPixelShaderFile   = "shaders/common/gl/planarReflectP.glsl";
   
   samplerNames[0] = "$diffuseMap"; 
   samplerNames[1] = "$refractMap";
   
   pixVersion = 1.4;
};

I don't think it's what cause my issue but should it be diffuseMap or texMap used?

ReflectBump shader seem wrong also but maybe it's ok to send diffuseMap sampler and set is as textMap in the shader code... :oops:

Code: Select all

samplerNames[0] = "$diffuseMap";
   samplerNames[1] = "$refractMap";
   samplerNames[2] = "$bumpMap";   
   

Code: Select all

TORQUE_UNIFORM_SAMPLER2D(texMap, 0);
TORQUE_UNIFORM_SAMPLER2D(refractMap, 1);
TORQUE_UNIFORM_SAMPLER2D(bumpMap, 2);

Does this works or diffuseMap/texMap should be the same?
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Tue Jan 12, 2016 9:43 am

Code: Select all

TORQUE_UNIFORM_SAMPLER2D(texMap, 0);
TORQUE_UNIFORM_SAMPLER2D(refractMap, 1);


That refractMap should be using tex unit 1, it's a typo in the shader. Good pickup ;) The shader uniform texture unit should match the samplerNames[N] from ShaderData

*Edit:

I updated my original d3d11 branch with this fix, i'm sure once az notices he will update the pbr branch too.
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Tue Jan 12, 2016 11:42 am
Mud-H wrote:

Code: Select all

samplerNames[0] = "$diffuseMap";
   samplerNames[1] = "$refractMap";
   samplerNames[2] = "$bumpMap";   
   

Code: Select all

TORQUE_UNIFORM_SAMPLER2D(texMap, 0);
TORQUE_UNIFORM_SAMPLER2D(refractMap, 1);
TORQUE_UNIFORM_SAMPLER2D(bumpMap, 2);

Does this works or diffuseMap/texMap should be the same?


It should actually work with D3D11 even though the names don't match(it works because the texture units match) BUT it's good practice to make sure it all matches up as a different API it may not work.
Mud-H
Posts: 175
Joined: Thu Feb 19, 2015 3:08 pm
by Mud-H » Tue Jan 12, 2016 11:50 am
Any ideas about what is causing the SkyBox with FogBandHeight > 0 issue? I think it's related to the new shader/D3D11 code so maybe it should be discussed here...

viewtopic.php?f=9&t=55&start=140#p4447

It also cause the SkyLine object to not render correctly.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 7
64 posts Page 1 of 7

Who is online

Users browsing this forum: No registered users and 1 guest