I am implementing Displacement mapping using DirectX 11 with its new tessellation stages.
Diffuse map and displacement map are generated by xNormal.
The result after I applied displacement mapping is cracked so badly.

Then I realized the values in the texture along seams are not the same/continuous, so I just use diffuse texture as displacement map, and the diffuse color is all-red.

The result is better but still 1-pixel gap along the seams.
I was confused by the little gap, so I enlarged the colored-part in the texture using MS painter, then the gap disappeared!

Now I just don't understand where the problem is. Even if the value along seams from different part of the texture is the same (red in this case), there are still gaps on the result model.

Here are the result screenshots. (reputation too low to post multiple links!)

I tried all sample filter here(MSDN) but nothing helps.

What causes the gap? It will be better if the problem can be solved by just modifying texture instead of changing my code.


1 Answer 1


Try hard-coding a constant displacement value, such as 1.0. If you still get cracks when using a constant displacement then look at your displacement vectors. How are you calculating them? They need to be exactly, bit-for-bit, equal across the seams; any discrepancy in how they're calculated could lead to cracking. If you're using the vertex normal as a displacement vector, ensure that the normals in the mesh are exactly equal cross the seams.

Once you've gotten things working for a constant displacement value you can put back in the texture-based displacement, but you'll see cracks again. With irregularly shaped UV seams it's impossible in general to make the textures match up precisely across the seam (it can be done if the seam is perfectly horizontal or vertical in UV space and both sides of the seam are precisely the same length).

There are ways to fix the problem, but it requires building some extra vertex data and adding some code to the shader. The basic idea is to sample the displacement map on both sides of the seam, and interpolate the resulting displacement values smoothly across the seam so that there's no sharp discontinuity. A bit more detail can be found in the "My Tessellation Has Cracks" talk by Bryan Dudash, listed on this page.

  • \$\begingroup\$ I tried constant displacement by using an all-red diffuse texture as displacement map, there are still 1-pixel wide gaps on the model. But if I hard-code it into shader like PosW += 1.0f * NormalW, the gaps will be closed. \$\endgroup\$ May 28, 2013 at 1:34
  • \$\begingroup\$ I've seen a texturing tool to fix this kind of problem but it wasn't released. The tool is used to find edges in the texture and corresponding UV seams, and 'smooth' them or something like that. Anyways the idea is the same with yours. \$\endgroup\$ May 28, 2013 at 1:38
  • \$\begingroup\$ Thank for the information, I will try to fix it procedurally. \$\endgroup\$ May 28, 2013 at 1:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .