码迷,mamicode.com
首页 > 其他好文 > 详细

Can I compile and run Dx11Shader for Maya 2015 on my side?

时间:2014-12-09 17:04:49      阅读:308      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   ar   color   os   sp   

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.

 

bubuko.com,布布扣

 

But in case if you do have need to build it on your side now, I detailed the steps and also the reason as follow, and please also contact us to get the correct library.

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.

 

Code Snippet
  1. // for VS 2012, Win8 SDK includes DX sdk with some header removed
  2. #if_MSC_VER >= 1700
  3. #include<dxgi.h>
  4. #else
  5. #include<d3dx11.h>
  6. #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 just contact us, and we will try to find a way to help you. Sorry about the limitation.

Can I compile and run Dx11Shader for Maya 2015 on my side?

标签:des   style   blog   http   io   ar   color   os   sp   

原文地址:http://www.cnblogs.com/johnonsoftware/p/4153349.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!