简体   繁体   中英

Visual Studio c++ 2012 and shader Questions

I'm using VS c++ 2012 and Directx 10 and have encountered some problems.

I found that in vs 2012, I can add .hlsl files directly and can choose which type of shader to create, such as vertex or pixel shader. But I can only add one type of shader at a time, unlike previously in vs 2010, I could just create and load a .fx file that contains both vertex and pixel shader and the technique. With present situation, I can add separate .hlsl files but I have no idea where to put the Technique to. Also I noticed that the 2012 version cannot find D3D10CreateEffectFromFile. How does Shader work in vs 2012 version? If I just want to use a vertex shader and one pixel shader, how can I do that?

It is a long time that i don't work with directX, but i think it doesn't depend on visual studio version and even also directX. in DX10 and also DX11 you can create a fx file that contain different types of shaders along with a technique.(but in directx 11 you must include effect class in your project) but in DX11 you can also use hlsl files that i think it can contain all types of shaders, just in compiling you send name and type of your specific shader to DX11 functions and i think in DX11 this approach is prefered way. For D3D10CreateEffectFromFile i have no idea but i think you don't include headers correctly. again i say it is long time that i don't work with DX and my answer can be incorrect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM