1

Topic: Displacement mapping

Hello,

Is anybody interested in or have experience with using displacement mapping as a modeling tool? Have you had any challenges with using displacement mapping?

At VTT Technical Research Centre of Finland we have created a code, aimed at product design, that can produce very highly optimized and accurate triangular meshes of high-resolution displacement-mapped 3d models.

The mesh density can be directly controlled by an absolute tolerance value that can be matched with the printer resolution. This produces a mesh of optimal resolution for the slicing process.

Unfortunately we can't make the code available yet, but if anyone is interested in trying it out, you can send us a model to be processed, with the condition that we get a permission to make a print for demonstration purposes as well.

You can contact me directly at [email protected].

--
Reino Ruusu
VTT Technical Research Centre of Finland

Post's attachments

gradient.png 412.91 kb, 3 downloads since 2012-12-19 

liquid_chocolate.png
liquid_chocolate.png 105.29 kb, 3 downloads since 2012-12-19 

You don't have the permssions to download the attachments of this post.

2 (edited by caswal 2012-12-19 16:29:19)

Re: Displacement mapping

My housemate just did something very similar to this while modelling a coffee bean (for an explanatory model of a coffee cherry), using 3DS Max. It took me a few minutes to knock this up in 3DS Max myself:

https://lh3.googleusercontent.com/-Nth-x6pmN6w/UNHme8UaPiI/AAAAAAAAAxk/967rlKarEwE/s1152/OptimizedDisplamentMap.PNG

It would be interesting to see how this software could make this process more accessible, I do have a few questions.

How does it unwrap the object and map the displacement map to it?
How does it cope with wrapping the map around an object and making it tile/loop? Rather than the relatively flat object in your example or mine,  will it produce a seem where the map starts and ends when it loops around an object? Or does that depend on the input map itself, I noticed that your example displacement map is tileable.

Is it smart enough to know how to automatically tile the map, or do you have to tweak that yourself?

Have you looked at displacement mapping techniques used by games and films? As it has been used there for numerous years.

Lead Programmer & Co-Owner of Camshaft Software - Creators of Automation - The Car Company Tycoon Game

3

Re: Displacement mapping

I sometimes use displacement maps. Just depends on what's needed. New modeling tools are always interesting. I have some questions too.

Is this intended to be a stand-alone application or a plug-in for existing modeling programs?

Can you offer an analysis of what the project was looking to achieve or solve? I'm having a difficult time seeing how this adds to current solutions though.

4

Re: Displacement mapping

Sorry for the delay... Our code doesn't do mapping, only the conversion to a triangle mesh. The image can be tiled or mirrored and the texture coordinates can be scaled, translated and rotated. Seams in the mapping result in a stair step, unless the image happens to match over the seam.

At the moment, the algorithm has been implemented as standalone software, but a plug-in is one of the development possibilities.

The original use of the code was for texturing plastic injection molds with a laser engraving tool. The precision requirements were considerable for very fine textures, like artificial leather, and we ran into serious problems with using the existing tool base, including 3ds Max, which produced a prohibitive amount of triangles. (This was with the 2010 version.)

Caswal, you seem to have applied an optimization step after the displacement. What was the original polygon count? The picture in my original message is a direct output of the triangulation method and involves no post-processing steps for optimization.

The code is also able to directly produce an STL of the difference between the displaced and the original surface, which is quite useful for traditional subtractive manufacturing. This would be a very time-consuming process as a post-processing step. We are planning to try it out for adding details with a 3d printer on the surface of an existing object.

Games and films nowadays almost exclusively use per-pixel displacement mapping, which is not directly applicable to manufacturing. A slicer that directly interprets the displacement map could be possible, but is probably not worth the effort.

5

Re: Displacement mapping

Whoops. The original count of the optimization is visible in the image.

The 3ds Max ProOptimizer and Optimize modifiers are built for controlling the angular precision of the model. This is fine for rendering purposes. For fabrication, one needs to directly control the actual spatial accuracy. With angular control either small details are produced with unnecessary precision or polygons will be visible on large surfaces.

6

Re: Displacement mapping

rruusu wrote:

Games and films nowadays almost exclusively use per-pixel displacement mapping, which is not directly applicable to manufacturing. A slicer that directly interprets the displacement map could be possible, but is probably not worth the effort.

Not since DX11 became available as a standard for games, it is now a combination of tessellation and vertex displacement. DX11 can dynamically subdivide an object so each triangle to will take up a certain area of pixels on the screen. Objects further away have lower amounts of tessellation compared to object much closer to the screen.

http://img40.imageshack.us/img40/9192/notessellation1.jpg
http://img266.imageshack.us/img266/7111/withtessellation1.jpg

Why were the amounts of triangles prohibitive? What sort of counts are we talking about?

Lead Programmer & Co-Owner of Camshaft Software - Creators of Automation - The Car Company Tycoon Game

7

Re: Displacement mapping

OK this makes sense now. Your description seems very similar to what ZBrush and Sculptris do for selectively adding polygons where there is detail and not adding polygons where they're not needed. If that's correct then that's good optimization workflow. 

I imagine at some point Slic3r will balk at a certain level of polygon detail but I haven't reached that yet.

I'd also be interested to know what polygon count you ran into difficulty with and where in the process that happened.

8 (edited by rruusu 2012-12-31 11:48:02)

Re: Displacement mapping

While generating meshes with a resolution in the less than 10 micron range, we easily ran into tens of millions of triangles. 3ds Max also tended to skip some of the details, leaving horrible "scars" in the mesh, especially if the base mesh was badly shaped.

The existing tools are all based on subdivision of the mesh. This leads to problems when trying to create sharp features. Pure subdivision-based algorithms have a problem with edges that cut across a corner in the shape, creating corners that look like they have "bites" taken out. To address this, one needs to make the mesh fine enough that the "bites" are within the required tolerance.

Maya includes a code (called Feature-Based Displacement) that partially addresses this by adjusting the locations of the created vertices after subdivision, but it is only used for very sharp features. Maya also has problems with uneven adaptation and lacks direct control of the spatial tolerance.

Subdivision-based codes seem to be very sensitive to the quality of the underlying mesh, which is a problem when the starting point is something like an STL triangulation. STLs need to be processed anyway in order to achieve a good unfolding, but still there is usually an abundance of very narrow triangles.

Our algorithm is not based on subdivision at all. Instead it uses direct insertion of new vertices at points of interest, based on a greedy algorithm that chooses the vertex locations by eliminating the largest deviations first. The result is that the inserted vertices very nicely follow the features of the displacement map and effectively eliminates all edges that cut across the displacement features. If the displacement map contains flat regions, effectively no vertices at all are inserted into those regions.

Even with highly optimized meshes some of our path generations for laser engraving took hours. I don't think that the resolutions with extrusion-based 3d printing is yet at a level where the resolution requirements would be high enough to cause significant problems.

The attachment includes an extreme example of a 3d model that was first processed into a depth map in ZBrush and then displaced onto a rough mesh patch. The original triangulation of the model is quite well preserved. A tolerance setting level below the actual spatial resolution of the image results in an accurate reproduction of the aliasing on the vertical features. smile

Post's attachments

rhino.png
rhino.png 248.39 kb, 3 downloads since 2012-12-31 

You don't have the permssions to download the attachments of this post.

9

Re: Displacement mapping

The algorithm produces meshes that would be absolutely awful for rendering purposes, because it doesn't aim to produce evenly shaped triangles. Instead, it produces highly optimal descriptions of the solid volume in the spirit of the typical STL triangulation.

10

Re: Displacement mapping

I guess there are quite a lot of tessellation-based engines still in use for rendering, but the future is in pixel shader-based GPU implementations, such as parallax mapping or relief mapping. These techniques completely remove the need for any mesh subdivision for rendering even the most complex displacement maps.

11

Re: Displacement mapping

rrussu, tesselletation is a brand new feature set in DirectX 11 (released in 2009), it is being used to overcome problems with parallax and relief mapping. Pixel Shader techniques are great, but they don't fix silhouettes and have other problems. The pictures I provided are from a recent graphics demonstration of these techniques.

Lead Programmer & Co-Owner of Camshaft Software - Creators of Automation - The Car Company Tycoon Game

12

Re: Displacement mapping

wow this is some good work !

13

Re: Displacement mapping

caswal, thanks for the correction. Anyway, the criteria for a good tessellation are a bit different for rendering and fabrication purposes.