Jump to content
  • Advertisement
Sign in to follow this  
striker87

Question about Rastertek tutorials

This topic is 2560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if anyone has gone through the tutorials on rastertek.com and if so is it possible to get the terrain tutorials to work with D3D10 instead of 11 or would that require changing a lot of things as wanting to do those tutorials if possible without having to do a lot of modifying to get it to work with D3D10. Any help will be appreciated and if anyone knows of any other good tutorials please let me know. Thanks!

EDIT:

I did some searching I think I might have found the answer but please correct me if I'm wrong but I think all I will need to do is set the feature level like this:

D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};

and that should allow the programs to run on a D3D10 or 10.1 device without having to change any other code correct?

Share this post


Link to post
Share on other sites
Advertisement
I actually started my C++ learning with the Rastertek tutorials. :)

In fact, at the time it was DX10 code hah. As far as moving it from 11 to 10, it's mostly transparent. The feature level is probably the best way to go as it's less work and you can bring your engine to DX11 whenever your hardware is ready, but if you want to move to DX10 entirely, you mostly have to change some names from things like "ID3D11Texture2D" to "ID3D10Texture2D" etc, and replace the "ID3D11DeviceContext" stuff with "ID3D10Device". As far as I know that's all I had to do to move my engine from DX10 to DX11 (which I then set to Feature Level 10 for my DX10 hardware). Anything else is just minor code changes. :)

Good luck!

Share this post


Link to post
Share on other sites

I did some searching I think I might have found the answer but please correct me if I'm wrong but I think all I will need to do is set the feature level like this:

D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};

and that should allow the programs to run on a D3D10 or 10.1 device without having to change any other code correct?


You will also have to change shader model version from 5.0 to 4.0 when compiling shaders ("pProfile" parameter).

Share this post


Link to post
Share on other sites
Thanks for the help guys! I really appreciate it. I also have another question as I saw that the code is using d3dx10math.h and was wondering which is better between it and xnamath.h. If xnamath.h is something I should use how difficult would it be to change the code from using d3dx10math.h to using xnamath.h. Again thanks for the help.

Share this post


Link to post
Share on other sites
Just wanted to let anyone who might be interested that I have updated the code from the Rastertek Initialize DirectX 11 tutorial to also work with DirectX 10 devices in attempts to be able to do the terrain tutorials once I reach them. Here is a link to my updated code which what I updated was in the d3dclass.cpp as modified the code for featureLevel.

http://dl.dropbox.com/u/6991288/Initialze%20DirectX.zip

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!