For some reason I can not find a good example of terrain rendering, as in like "bare bones". Im reading Introduction to game Programming with DX10, and i've seen some other tutorials....but they all are complicated classes with ALOT of stuff thats unnecessary, and tbh just confuses a beginner like me. Like Raserteks tutorials are awesome, but it's SOO much code and classes, it's very difficult to understand the "3d" part when you have so many other classes.

Im just looking for the most BASIC terrain rendering (using a heightmap....or what have you).

It doesn't even have to have a camera or movement control, hell it can just be of one color. Im just trying to understand everything first. Does anyone know where I could find a sample of this? or heck if anyone would be willing to provide a simple sample of their own i'd be mega appreciative.

Dont get me wrong, the Book is great.....and I understand the functions, but the way the classes are put together...it makes it confusing of "what goes where".

edit: I've seen some Direct X 9 terrain demo's/samples....but isn't DX9 like WAYYY different from DX10 (if so thats why I wouldn't want to waste time on it). I could be wrong though.


1 Answer 1


D3D9 is quite different from an API perspective than D3D10, but the underlying concepts are very similar. Any terrain rendering example in D3D9 (such as this one) will work fine in D3D10, you'll just have to translate the API calls which shouldn't be that difficult. Similarly, since the techniques for rendering terrain are in no way API-specific, you could even take a look at a tutorial geared for an OpenGL user, like this one.

Both of those articles illustrate very basic hieghtmap-based terrain using simple grids.

  • 2
    \$\begingroup\$ I would agree with this answer even if it was implemented in OpenGL. The concept is what you need to worry about here. I would definitely avoid finding code that you can directly copy over. If you don't understand what the code is saying, that's a good hint you shouldn't copy it! :) Having this in DX9 is going to get you much closer though. Once you understand what the algorithms are doing in DX9, translating it into DX10 will be a good exercise as this will force you to know what's going on! \$\endgroup\$
    – brandon
    Commented May 9, 2011 at 15:45
  • \$\begingroup\$ Ya thats why im trying to understand everything before I move on, but man...DX10 has so much initialization stuff it can get very confusing. \$\endgroup\$
    – user6465
    Commented May 9, 2011 at 16:07
  • \$\begingroup\$ +1 for Chad Vernon's article as it really helped me understand and implement my own heightmap based terrain a while back. A word of warning though, the formatting of the code on the site is sometimes dodgy (for me it was anyway) as some --x are seen as -x which gives you a very different outcome. \$\endgroup\$
    – Ray Dey
    Commented May 9, 2011 at 17:09

You must log in to answer this question.