Tutorial by Meats Meier
The Material Capture function in ZBrush is an excellent way to sample the lighting and material of an object. It can be used to quickly simulate a texture from a photograph or rendering, and then can be used as either a real time shader, or as a shader meant to seamlessly composite ZBrush rendered 3d objects into photographs.
1. To capture a material, the first step is to find and prepare a photograph of an object with a material that you would like to simulate. Identify key areas of the photo, such as clean areas that show the pure surface color, as well as texture and cavities. The more information in the photo, the better the results will be because of course there will be more information to sample from, and you can get a more realistic result.
2. Prepare the image in photoshop, and save it as something that ZBrush can read, such as .bmp, .psd, or .jpg. I sometimes copy a version of the object, place it near the original, and darken it to make sure that I have dark areas that I can sample from for the cavity creation later on. In ZBrush, I bring in the image with Texture:Import, select the flat color material, and fill the screen with the image using Texture:CropAndFill.
3. It can also be very helpful to place 3d objects on the canvas that are roughly the same shape as the object itself, this lets you quickly see if your material is behaving like the one in the photo.
Select one of the real time shaders (the main red wax is fine). This is the material you’ll be modifying to create your own MatCap material. Place objects around the object, but do not cover any of the parts of the image you are trying to capture.
4. Select the MatCap tool in the Tool palette and then open and dock the Material Palette.
In these next steps, you will sample different angles (normals) of the object in the photograph. The lines show some of the normals I defined when estimating planes in the image.
5. We’ll first sample the only pure color information in the photo. Avoid shadow, specular, and cavity areas of the image. We’ll actually end up creating two shaders in the material–MatCap A and MatCap B. MatCap A is the color information, and MatCap B is the shader we’ll create a bit later that Zbrush will user when rendering cavity effects.
Making sure the Tool:MatCap tool is still selected, left click on a point the background image and drag the mouse around to define a surface normal. Let the mouse up when you have a normal you think reasonably close to the real normal of the object in the image (don’t worry about precision, you will do many samples, and they will all work and blend together nicely). As you make more and more markers on all visible angles on your image, you will see the temporary shader ball become closer and closer to the photograph. (See MatCap Basics for a fuller explanation of sampling points.)
6. To add the highlights, find the brightest parts of your photo, and sample them. To adjust the highlight itself, you can press the Ctrl key after you drag out a vector but before releasing the mouse, and then move your mouse left and right to control the “hotness” value of the shine. (MatCap Basics discusses this in more detail.) At this point, try changing some of the gloss, refine, intensity, etc. sliders in Material:Modifiers to bring the shader closer to realism.
7. To create the cavity part of the shader, press the Material:Modifiers:B button to tell ZBrush that we would like to work on the secondary shader. Now is the time to sample the dark, or cavity areas. You can also do a overall darken by just lowering the Intensity slider for a quick, darker, cavity.
Adjust the cavity detection and transition sliders in Material:Modifers to see the effect of the Material:Modifiers:B shader. You can also determine how much cavity vs. color is shown in Material:Modifers.
8. Save the material for use next time you use ZBrush by pressing Material:Save.