Defracture tool, a displacement map fixer.

A blog post about fixing displacement maps for use tesselation work out and real time displacement. (First steps on the new adventure of developing a 3D game with "next gen" technology, with the glory of tesselation.)


(Taken from a renewed deb blog by Ofer)

I have been working lately on displacing geometry of a 3D model in real time, after it was tesselated.
Displacement maps means I modify the geometry vertices position according to a height map texture. The issue is that most game models don't have enough geometry to support the fine details of the texture. You could send a lot of geometry to the shader, but this is wasteful. Instead, I subdivide the mesh inside the shader pipeline(tesselate).

I bought a nice 3D model of a stone golem that had normal maps but no displacement maps(height maps + normal maps). I decided to generate the height map using CrazyBump.
That worked pretty nice, but there was an issue. After displacement the model had gaps in certain parts of its surface.

The reason was that because the 3D model was stitched at certain places, like the shoulders and the head. Artists do that so they can unwrap the model's surface into a 2D space which is required for mapping the texture.
The gaps appeared in those stitched areas because they had duplicate vertices in the same position but with different texture space coordinates.
CrazyBump only use the image and has no reference of the geometry, so it can't tell there are different places in the texture that belong to the same 3D position in the model.

What I did to fix this is go over all the edges of the triangles that are shared in the 3D model, but are separate in the texture space. Then I just made the pixels in the height map on these edges share the same values for both edges. I had to make this edge fix more than 1 pixel width and it wasn't a simple challenge.
This image shows where I fixed the displacement map. In practice I didn't put black colors on the image, but rather an average of values on the two edges.

Denoting the edges

Here are the results:

Latest Jobs


Playa Vista, Los Angeles, CA, USA
Senior Level Designer (Zombies)

PlayStation Studios Creative Arts

Petaling Jaya, Selangor, Malaysia
Lead Concept Artist

High Moon Studios

Carlsbad, CA, USA
Technical Designer at High Moon Studios

High Moon Studios

Carlsbad, CA, USA
VFX Artist
More Jobs   


Explore the
Advertise with
Follow us

Game Developer Job Board

Game Developer


Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Advertise with

Game Developer

Engage game professionals and drive sales using an array of Game Developer media solutions to meet your objectives.

Learn More
Follow us


Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more