Sign in to follow this  

DirectX 11 terrain rendering

This topic is 1448 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

So, I'm reading Frank D. Luna's Introduction to 3D Game Programming With DirectX 11 but my video card doesn't support DirectX 11 (D3D_FEATURE_LEVEL_11_0) so I switched back  to feature level 10 (D3D_FEATURE_LEVEL_10_0) and I'm at the chapter "Terrain rendering" which does tessellation (tessellation is only supported on directx 11) but since my video card doesn't support it, I can't run it. 

 

So what should I do now to remove tessellation?

Share this post


Link to post
Share on other sites

Hi nt,

 

What do you mean by remove tessellation, simply not use it?

 

You have many different ways of doing the same thing, like: (Not talking about performance)

  • You could create the terrain on the cpu side, load the heightmap, and then create a mesh which starts as a plane (The plane needs to be sub divided somehow, you could call it a grid ) but is pulled accordingly to the color on the heightmap, then render this almost pre made terrain with no tessellation.
  • You could also have a plane which is sub divided into multiple parts (The quality of the terrain depends on the resolution of the plane, and again, some people call it a grid), then in the vertex shader pull the vertices up and down according to the height map sent to the gpu. (I think this can be done in dx10)

And there's probably more, but I'm not aware of them right now smile.png

 

Hope this may help you. wink.png

-MIGI0027

Share this post


Link to post
Share on other sites

You can also load the height map as a texture and use vertex shader texture fetch. No need to store anything inside a vertex buffer.

 

You may use the vertex index to create the terrain geometry in the shader. This should work on DX10 hardware. Only thing you'll need is a set of indices. Many games use a quad tree to tesselate the terrain and for each node they use a fixed size grid (33x33 for example). The cracks can be avoided with several set of grid indices with T-junction correction. 

 

The algorithm can be made much simpler with D3D11 level hardware by using tesselation (the mesh can be totally created on GPU and the T-junctions can be fixed with simple parameters).  

 

Cheers!

Share this post


Link to post
Share on other sites

I ran into this exact problem when I was working through that book on one of my machines that had a crap video card.  I ended up implementing a CPU-based LOD system, by dividing the terrain mesh into patches and using a different set of vertex and index buffers for each LOD level.  Using the vertex shader to offset the patch vertices, you only need to keep one set of the LOD buffers around, so this isn't as hard on performance and memory as you might imagine...

 

My code is for C#/SlimDX, but it might give you some ideas.  I had lots of fun figuring out how to remove T-junctions between different LOD levels.

Share this post


Link to post
Share on other sites

This topic is 1448 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this