### 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
• 3
• 4
• 5
• 6
• 7

#### Re: Pre-Pull Request: D3D11 Initial testing

Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
@
TorqueFan
ok sweet glad it's working, i sent an official PR for those fixes.

Ok now to the detail maps, go grab a coffee or something because i have to blabber a bit to explain this one. This is not just aimed at you torquefan, it's more a general post about it because this topic will come up once 3.9 is officially released for sure, <insert help my detail maps are now black>

The detail maps are greyscale(luminance) images that have values from 0-255 (0.0f -1.0f if using that scale). In the shader these textures are brought from 0.0f -> 1.0f range into -1.0f -> 1.0f range. This has always happened in T3D, so nothing new here.

The reason it is brought into that -1.0 -> 1.0 range is so you get a chance as an artist to either have that detail map darken or brighten the diffuse texture. So a pixel value of 128(approx) will now be mapped to 0 (it won't brighten or darken anything). Previously this was hidden a lot because the blending etc was done in the wrong space and you could get away with really dark detail maps and it would look ok, not anymore. I won't get into the new linear workflow,i'll keep this about the detail maps but this is a good read on the subject http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html.

Back to detail maps and few examples to show what i mean:

Dark map (art/terrains/example/rocks1_d.png). Take note of the mean, it's fairly dark and look at those black parts

Brighter detail map (art/terrain/example/sand_d.png)

Now if we change that sand detail map to greyscale, note the average is now 126. Pretty close to 0 once it's mapped so it won't brighten nor darken anything

Lets see how these look in game now

Rocks1_d: Horrible but not surprising when you see how dark it is above

Turn the detail strength down and better

Don't mind the detail color checkbox, was just playing around to make it more friendly for people who insist on using color in their detail maps.

#### Re: Pre-Pull Request: D3D11 Initial testing

TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
@
Timmy
...research complete! Thank you so much, I do enjoy a good read! You, sir, are a gentleman and a scholar.

That all makes sense, and I'll be adjusting some of my detail maps accordingly to suit.

By the way I did run into one other small issue with the GuiObjectView port, where the background isn't transparent. I believe @
Azaezel
has a better understanding of the source of the issue.

In this post, he gives mention to some changes to the class that may be necessary to make a 'complete' conversion of GuiObjectView from the old to the new. Some may not be necessary, per say, but as the goal is always to innovate and improve I believe all of his proposed updates could benefit the class.

#### Re: Pre-Pull Request: D3D11 Initial testing

Dwarf King
Posts: 157
Joined: Thu Feb 05, 2015 7:20 pm
Timmy wrote:For anyone interested the phase 2 of all this work will be here https://github.com/rextimmy/Torque3D/tree/dx11_phase2. Just be warned though, i can't guarantee it will always be stable, so treat it as experimental.

No problem @
TorqueFan
, it was a lot of hard work but quite a few people not just myself.

Thanks a lot! I shall play around with it.

#### Re: Pre-Pull Request: D3D11 Initial testing

Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
Dwarf King wrote:
Timmy wrote:For anyone interested the phase 2 of all this work will be here https://github.com/rextimmy/Torque3D/tree/dx11_phase2. Just be warned though, i can't guarantee it will always be stable, so treat it as experimental.

No problem @
TorqueFan
, it was a lot of hard work but quite a few people not just myself.

Thanks a lot! I shall play around with it.

Not much has been done on that branch yet, still designing all the new constant buffer stuff which is going to take a little bit, until that goes in dx11 will lag behind dx9 on pure speed. Hopefully i finish in time for 3.9 release but if not it won't be too far behind. Having said that, dx11 is definitely in a working state though.

#### Re: Pre-Pull Request: D3D11 Initial testing

Dwarf King
Posts: 157
Joined: Thu Feb 05, 2015 7:20 pm
Timmy wrote:
Dwarf King wrote:
Timmy wrote:For anyone interested the phase 2 of all this work will be here https://github.com/rextimmy/Torque3D/tree/dx11_phase2. Just be warned though, i can't guarantee it will always be stable, so treat it as experimental.

No problem @
TorqueFan
, it was a lot of hard work but quite a few people not just myself.

Thanks a lot! I shall play around with it.

Not much has been done on that branch yet, still designing all the new constant buffer stuff which is going to take a little bit, until that goes in dx11 will lag behind dx9 on pure speed. Hopefully i finish in time for 3.9 release but if not it won't be too far behind. Having said that, dx11 is definitely in a working state though.

Pointing a finger at you with a very serious look and say... Did I tell you that you are my favorite Torque tech user?

Thanks a lot for doing this @
Timmy

#### Re: Pre-Pull Request: D3D11 Initial testing

PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
Hey all,

Bringing this discussion over here from the RiftDK2 thread, since it is more related to DX11...

I just did a fresh build of a freshly created Dx11 project, using the current T3d_Development github download...

Am working in 64 bit, so I removed the .asm files from the project as usual.

Not adding in any Oculus or OpenVr support, this is just stock.

And I get these unresolved externals:

1>------ Build started: Project: Dx11Test DLL, Configuration: Release x64 ------
1>../../Link/VC2010.Release.x64/Dx11Test DLL/fileDialog.obj : warning LNK4042: object specified more than once; extras ignored
1> Creating library ../../../game/Dx11Test DLL.lib and object ../../../game/Dx11Test DLL.exp
1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol CreateDXGIFactory1 referenced in function "private: virtual void __cdecl GFXD3D11Device::enumerateVideoModes(void)" (?enumerateVideoModes@GFXD3D11Device@@EEAAXXZ)
1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol D3D11CreateDeviceAndSwapChain referenced in function "public: virtual void __cdecl GFXD3D11Device::init(struct GFXVideoMode const &,class PlatformWindow *)" (?init@GFXD3D11Device@@UEAAXAEBUGFXVideoMode@@PEAVPlatformWindow@@@Z)
1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol D3DCompile referenced in function "public: virtual class GFXVertexDecl * __cdecl GFXD3D11Device::allocVertexDecl(class GFXVertexFormat const *)" (?allocVertexDecl@GFXD3D11Device@@UEAAPEAVGFXVertexDecl@@PEBVGFXVertexFormat@@@Z)
1>gfxD3D11Shader.obj : error LNK2001: unresolved external symbol D3DCompile
1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DReflect referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z) 1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DDisassemble referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)
1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DCreateBlob referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z) 1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol D3DXDisassembleShader referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)
1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol DXGetErrorStringA referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z) 1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol DXGetErrorDescriptionA referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector<struct GFXShaderConstDesc> &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)
1>gfxD3D9TextureManager.obj : error LNK2019: unresolved external symbol D3DXLoadSurfaceFromMemory referenced in function "protected: virtual bool __cdecl GFXD3D9TextureManager::_loadTexture(class GFXTextureObject *,class GBitmap *)" (?_loadTexture@GFXD3D9TextureManager@@MEAA_NPEAVGFXTextureObject@@PEAVGBitmap@@@Z)
1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol Direct3DCreate9 referenced in function "protected: static void __cdecl GFXPCD3D9Device::createDirect3D9(struct IDirect3D9 * &,struct IDirect3D9Ex * &)" (?createDirect3D9@GFXPCD3D9Device@@KAXAEAPEAUIDirect3D9@@AEAPEAUIDirect3D9Ex@@@Z)
1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_BeginEvent referenced in function "public: virtual void __cdecl GFXPCD3D9Device::enterDebugEvent(class ColorI,char const *)" (?enterDebugEvent@GFXPCD3D9Device@@UEAAXVColorI@@PEBD@Z)
1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_EndEvent referenced in function "public: virtual void __cdecl GFXPCD3D9Device::leaveDebugEvent(void)" (?leaveDebugEvent@GFXPCD3D9Device@@UEAAXXZ)
1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_SetMarker referenced in function "public: virtual void __cdecl GFXPCD3D9Device::setDebugMarker(class ColorI,char const *)" (?setDebugMarker@GFXPCD3D9Device@@UEAAXVColorI@@PEBD@Z)
1>sfxXAudioDevice.obj : error LNK2019: unresolved external symbol __imp_X3DAudioCalculate referenced in function "public: void __cdecl SFXXAudioDevice::_setOutputMatrix(class SFXXAudioVoice *)" (?_setOutputMatrix@SFXXAudioDevice@@QEAAXPEAVSFXXAudioVoice@@@Z)
1>sfxXAudioDevice.obj : error LNK2019: unresolved external symbol __imp_X3DAudioInitialize referenced in function "public: __cdecl SFXXAudioDevice::SFXXAudioDevice(class SFXProvider *,class String const &,struct IXAudio2 *,unsigned int,unsigned int,unsigned int)" (??0SFXXAudioDevice@@QEAA@PEAVSFXProvider@@AEBVString@@PEAUIXAudio2@@III@Z)
1>../../../game/Dx11Test DLL.dll : fatal error LNK1120: 16 unresolved externals
2>------ Build started: Project: Dx11Test, Configuration: Release x64 ------
2> Dx11Test.vcxproj -> C:\Torque\Torque3D-development\My Projects\Dx11Test\buildFiles\VisualStudio 2010\projects\../../../game/Dx11Test.exe
========== Build: 1 succeeded, 1 failed, 15 up-to-date, 0 skipped ==========

Any ideas what step I may be missing?

Oh and my OS is Windows 7, video card is 2GB Radeon (older but still good). I have Dx11, dxdiag reports version 11 with no issues. Other DirectX11 games work fine. So drivers and environment should be fine for this.

Thanks again for the help, cheers
P

#### Re: Pre-Pull Request: D3D11 Initial testing

Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
If you are going to do 64bit builds i highly recommend using cmake to generate the project files for you, the project manager doesn't "officially" support 64bit and you gotta manually do some things to make it work. Sounds like something is wrong with the paths in your case and is not finding the dx11 libs it needs to link against. Can you show what paths it has?

#### Re: Pre-Pull Request: D3D11 Initial testing

PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
OK, I figured that out, typical include pathing error I had to hunt down, grr.

Anyhow, it compiles fine, and runs fine too, I can switch to DirectX11 in the video options and everything looks good.

However, when I add in my custom code which includes the Oculus/Vr support, I get this error on startup when in DX11 mode (dX9 loads fine):

D3D11 ERROR: ID3D11DeviceContext::Map: Map cannot be called with MAP_WRITE_DISCARD access, because the Resource was not created with the D3D11_CPU_ACCESS_WRITE flag. [ RESOURCE_MANIPULATION ERROR #2097210: RESOURCE_MAP_INVALIDMAPTYPE]
..\..\..\..\..\Engine\source\gfx\D3D11\gfxD3D11IndexBuffer.cpp(97,0): {Fatal} - GFXD3D11PrimitiveBuffer::lock - Could not lock primitive buffer.

Any ideas on that one?

Thanks

#### Re: Pre-Pull Request: D3D11 Initial testing

Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
Ok glad it worked. With the error above, this will most likely be coming from some of that custom code, i'm sure james would have given me a nudge by now if that one popped up. Check the code and make sure the primitive buffer that is causing this error is not created with GFXBufferTypeStatic and than you are trying to update it, if it requires data to be changed than you must use GFXBufferTypeDynamic or GFXBufferTypeVolatile (depending on what your usage is for this buffer). DX11 is very strict on this compared to DX9

#### Re: Pre-Pull Request: D3D11 Initial testing

JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
Hi,

Has anyone tried creating an accumulation volume in the DX 11 build? I am getting a crash with "unable to compile shader", this doesn't happen on the Dx9 build, but I can't actually see the accumulation on Dx9 either.

If anyone could confirm that accumulation works on DX 11, I will at least know if it's just my build or not. I am using the Dx11/OpenVR build.
• 1
• 3
• 4
• 5
• 6
• 7

#### Who is online

Users browsing this forum: No registered users and 1 guest