3
\$\begingroup\$

enter image description here

This is the problem I'm having: where the height has been applied to the vertex, the edge of each face has been pushed apart. I was wondering how I can best deal with this issue?

I read elsewhere that calculating the mean between the two adjacent edge vertices and applying to both will seal the gap, but wouldn't that cause some UV stretching?

Any advice would be great, Caius.

\$\endgroup\$
2
\$\begingroup\$

It looks like when you apply the displacement map, you're pushing vertices out along the face normal of the underlying mesh? Instead of using the face normal, you should use the smooth vertex normal - which means you will need to interpolate across the face from its vertex normals. Smooth normals will match across edges automatically, so displacements along them should not generate cracks.

For more discussion of this issue, see the GDC talk My Tessellation Has Cracks (pdf).

\$\endgroup\$
3
  • \$\begingroup\$ Not sure it's worth creating a new question over, but I've applied the technique described within that paper. The results I've had are promising it's closed the large gaps and I completely understand why they were occurring. However I'm now having a smaller cracks issue. It seems as if they occur on the corners of each face, do you have any ideas reading this new problem? Thank you so much for your original answer. \$\endgroup\$ Jan 2 '13 at 9:22
  • 1
    \$\begingroup\$ @CaiusEugene Assuming there are no cracks in the underlying mesh, cracks at the corners are probably because your domain shader isn't applying exactly the same displacement to the corner vertex when it occurs in different faces. You'll have to go over your shader math and see if you can find what's causing that. \$\endgroup\$ Jan 2 '13 at 17:43
  • \$\begingroup\$ You were completely right, the problem I was having was down to the heightmap data being 32x32 and each plane I was applying it to was 33x33. Small gaps formed because the data was incorrect. \$\endgroup\$ Jan 3 '13 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.