Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Troubleshooting displacement maps

From: Creating Textures and Shaders in Maya

Video: Troubleshooting displacement maps

In this movie, I'm going to talk about some common problems that you may encounter when applying displacement maps that have been created in other programs. For example, I'd like to apply a displacement map that I created in ZBrush to this character that I'm rendering here in Maya. So, let's take a look at first how we can do this. Here's is a character right now with his skin shading network almost complete. I've got a subsurface scattering going, add a little bit of an ambient inclusion, I have a normal map applied, but to really make the details pop out and look more realistic, I'm going to add a displacement map to the surface.

Troubleshooting displacement maps

In this movie, I'm going to talk about some common problems that you may encounter when applying displacement maps that have been created in other programs. For example, I'd like to apply a displacement map that I created in ZBrush to this character that I'm rendering here in Maya. So, let's take a look at first how we can do this. Here's is a character right now with his skin shading network almost complete. I've got a subsurface scattering going, add a little bit of an ambient inclusion, I have a normal map applied, but to really make the details pop out and look more realistic, I'm going to add a displacement map to the surface.

So, the first thing I'm going to do is I'm going to select the surface and I'm going to create what's known as an Approximation node. So I'm going to go to Windows > Rendering > Editors > mental ray > Approximation Editor. And what this does is the approximation node actually subdivides the surface at render time allowing for more detail that can be used for displacements, so when the displacement texture is applied to the surface, so that at render time the surface is subdivided allowing for more detail to come through from the displacement texture.

So to create the node, I'll go to the mental ray Approximation Editor and under Subdivision I'm going to press the Create button. As long as I have the surface selected here in the scene, it's going to automatically apply this node to the surface, so I'll just choose Create and then it creates the node and it opens up in the Attribute Editor. There are several methods for creating a subdivision approximation. I'll just leave it at Parametric because that usually works pretty well for me and I am going to leave N Subdivisions at 2. What this setting basically determines is how many times a surface is going to be subdivided during the rendering process.

So I actually start with a value 2, and then if I need more, I can adjust it upwards. So now that has been applied, the next thing I need to do is hook up the displacement texture to my shading network. So I'll select the surface and open up the skinShader and what I need to do is I need to get to the shading group node above the skinShader, so I am going to Hypershade, right-click over the skinShader, and choose graph network. Let's take a look at the work area, so I am going to zoom in here and I'll select the skinShader and choose Graph, Input and Output Connections, and now I can see there is the shading group node right there.

So, I'm going to click on the checkerboard icon next to Displacement material in the misss_fast_skin_maya_2SG node. Actually what I might do is rename that real quick. Let's call this skinShaderSG. There we go. Now I'm going to click on the checkerboard icon next to Displacement. I'll choose File. I don't need to do anything here. I'll go to the file node and I'm going to click on the folder next to Image Name, and I'm going to use the madHatter1-DM.tif. This is a file that was created in ZBrush, where I also created the character. So I'll choose Open and this applies it.

I'm going to turn the Filtering to off, and since displacement maps take a while to render, let's just select a region and render just part of the image. Okay, this looks pretty good. Let's render the whole image. There we go. It looks pretty good. What happens when things go wrong? Let's take a look at a few things that might go wrong with that displacement textures. Now for one thing, if you don't have Alpha Is Luminance checked, this can sometimes cause problem, so I'm going to deselect Alpha Is Luminance and render a region again.

So you can see now what we have is something that looks like from a medical oddities textbook, so definitely a problem, and this is something that you can frequently encounter when you're rendering with displacement maps especially if they have been created in other programs. Now if Alpha Is Luminance is off, then it doesn't know how to interpret the alpha values to create the amount of displacements. You want to make sure that Alpha Is Luminance is turned on. Another common problem can be the settings with the Alpha Gain and the Alpha Offset.

In this case a value of 1 and a value of 0 works just fine. But depending on how the displacement map is made some programs interpret the light and dark values of displacement textures differently from Maya. ZBrush has been updated so that a value of 1 and a value of 0 usually work fine, but if you're using an older version of ZBrush, you might also encounter a similar type of bloating when you render even when Alpha Is Luminance is turned on. So in this case, what you want to do is set the Alpha Offset to minus one-half of the Alpha Gain, so this would be - 0.5 and this would be a value of 5.

In this case, it's working just fine, so I don't need to adjust those. So that's another frequent problem that you have. You might want to check how your program interprets displacement values. The way Maya works is that a value of black, in other words a zero value, means no displacement. A positive values means displacement outward, so lighter values means displacement outwards and negative values mean displacement inwards. Some programs create displacement maps where a value of gray is no displacement, values lighter than gray displays outwards, and values darker than gray displays inwards.

So in this situation if you're using a displacement map created in a program such as this and this is how ZBrush used to interpret displacement maps, you'd have to adjust the Alpha Offset so it's minus one-half of the Alpha Gain. Therefore I'm putting adjusting the values so that they go into the negative range. The other thing you need to look out for is a displacement map is affected by scale. So in other words, if this is a character that I needed to scale later on for some reason, like let's say it decided to grow really large in scene or I needed to adjust to scale to fit him into another scene, you'll need to adjust the Alpha Gain.

An easy way to do that is to set the Alpha Gain equal to the scale X of the object. So in other words the object itself is called oldMan. This is the name of the character in this version of the scene. So what I would need to do is go into the file texture used for the displacement, this texture right here, and one way you could do this is I could type in =oldMan.scaleX;.

And you can see this turns purple, meaning there is an expression. So that means that if I start to scale the oldMan up or down, the displacement texture automatically updates. So now that the oldMan is scaled up to 1.77 in X. The Alpha Gain is adjusted as well. So that's something that you need to be aware of. And then finally if you've find that your displacement map is lacking the detail that you think it should have, you can adjust the number of subdivisions, so I can pump this up to 3 and do another render. This will add to render time so you have to be careful, and if you make the value too high it can also cause mental ray to crash, so be careful when you start to crank that up.

And there's the final textured and displaced character and it looks pretty good. I frequently get this warning here that says Failed to open texture file displacement map.tif. I believe this is mental ray. It does not like the TIF format, so you get this warning because it's having a hard time creating a little preview icon for the displacement map. However, you know if I get this warning, usually displacement works just fine, especially if you remember to go into Settings/Preferences and under the Rendering menu activate Use optimized textures.

If you turn this on then displacement map should work just fine, even if you do get that warning. There you have it, a nice textured looking character, and he probably could go for some animation at this point.

Show transcript

This video is part of

Image for Creating Textures and Shaders in Maya
Creating Textures and Shaders in Maya

37 video lessons · 7892 viewers

Eric Keller
Author

 
Expand all | Collapse all
  1. 2m 19s
    1. Welcome
      1m 6s
    2. Using the exercise files
      1m 13s
  2. 17m 49s
    1. Explaining diffuse reflections
      2m 39s
    2. Defining glossy and blurred reflections
      2m 32s
    3. Looking at refraction
      4m 20s
    4. Describing the Fresnel effect
      1m 56s
    5. Understanding anisotropy
      1m 10s
    6. Identifying ambient and reflection occlusion
      1m 49s
    7. Defining sub-surface scattering
      2m 4s
    8. Simulating translucency
      1m 19s
  3. 1h 8m
    1. Using Maya's standard shaders with mental ray
      7m 2s
    2. Comparing mental ray and Maya shader nodes
      9m 12s
    3. Creating mental ray shaders
      2m 32s
    4. Making sense of mental ray shaders
      10m 35s
    5. Introducing the mia_material
      9m 16s
    6. Creating a custom mia_material preset
      9m 17s
    7. Looking at car paint materials
      6m 43s
    8. Using subsurface scattering shaders
      13m 33s
  4. 1h 5m
    1. Understanding UV coordinates
      4m 26s
    2. Comparing NURBS and polygon UVs
      4m 48s
    3. Mapping polygon UV surfaces
      13m 1s
    4. Using texture maps for color and other shader channels
      8m 1s
    5. Applying and projecting 2D procedural texture nodes
      4m 0s
    6. Applying 3D procedural texture nodes
      7m 1s
    7. Using ramp textures
      8m 12s
    8. Setting up utility nodes
      6m 29s
    9. Using file texture nodes
      9m 41s
  5. 22m 36s
    1. Applying the turbulence texture
      9m 37s
    2. Considering the round corners texture
      4m 17s
    3. Improving skin detail with ambient occlusion
      4m 27s
    4. Applying reflection occlusion
      4m 15s
  6. 33m 6s
    1. Painting bump maps
      4m 14s
    2. Creating normal maps
      5m 24s
    3. Applying normal maps
      6m 17s
    4. Creating displacement maps
      9m 14s
    5. Troubleshooting displacement maps
      7m 57s
  7. 33s
    1. Goodbye
      33s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating Textures and Shaders in Maya.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.