Can I compile and run Dx11Shader for Maya 2015 on my side?
Currently, you can find the source code of Dx11Shader under our devkit\plug-ins\ folder, but if you want to do some modification on this, can it be built and run within Maya 2015? Currently, the answer is Sorry! It’s currently a known issue, and hopefully, we will get this fixed in the coming release.
But in case if you do have need to build it on your side now, we have provided the updated project with the correct library at https://github.com/ADN-DevTech/Maya-dx11Shader-Sample. There is no Debug Effect component library provided as this time, so use Hybrid whenever you want to build the Debug version of your dx11Shader version.
Btw, if you are interested, here is some explanation and reason about the issue of the original project.
When you open the project, you will find the project file of Dx11Shader is still using VS 2010, which means based on VC 10. But it’s not compatible with Maya 2015. So 1st step you need to upgrade to VS 2012. Actually, for Maya 2015, you need to go with Visual Studio 2012 SP4.
After that, you should notice that there are some changes related to compiler version inside the source code, for example, at dx11Shader.h line #24 as follow. You will see the plugin uses different header files for VC 11(VC 2012) and above. Actually, these are not changes we need, but that Microsoft pushed to all dx11 developers. For more details about this, please read the article(mainly section 5) http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275(v=vs.85).aspx and http://blogs.msdn.com/b/chuckw/archive/2013/08/21/living-without-d3dx.aspx.
- // for VS 2012, Win8 SDK includes DX sdk with some header removed
- #if_MSC_VER >= 1700
- #include<dxgi.h>
- #else
- #include<d3dx11.h>
- #endif
In short, D3DX is not considered the canonical API for using Direct3D in Windows 8 and later and therefore isn't included with the corresponding Windows SDK. So for our Dx11Shader project with VS 2012, not only you still need to include $(DXSDK_DIR)Include and $(DXSDK_DIR)Lib\x64, but also you need to put the $(WindowsSDK_IncludePath) and $(WindowsSDK_LibraryPath_x64) first in the list of header file and lib search.
After the operation above, you should be successful build the project, but there are still some problems to run within Maya 2015, you will see an error saying like “ Error: Effect from file compile errors (AutodeskUberShader.fxo)”, means your Dx11Shader cannot work correct with HLSL shaders.
Why this problem occurs? Actually, it’s very tricky, and is also a current limitation. As you see, the Dx11Shader has a dependency on a static link library of effects11.lib, which is supposed to be located in DirectX SDK folder like C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Effects11\. Yes, that is true and it should work in previous Maya version. But unfortunately, Maya internally updated that project, so it cannot work anymore, and you need to link to our internally modified version of effects11.lib, but sadly, it’s not public to outside:(.
So if you want to make it work on your side, please try the updated one on Github https://github.com/ADN-DevTech/Maya-dx11Shader-Sample.