That's Not What I Painted! How to Avoid Nasty Surprises in Your Textures at Render Time
Have you ever seen a final render for an asset that you painted the textures on and thought to yourself, “Wow, that looks nothing like what I painted." You've probably seen it over and over again. Artists don’t always understand that the colors they paint into a diffuse map for an asset can change depending on the lighting applied at the time the asset is rendered. Sometimes the change is subtle and not really a big deal. Other times, the change can be quite drastic and may require that the texture artist revisit their textures to make needed changes.
So why does this happen and is there anything that can be done to ease the transition from the painting environment to rendering? Absolutely!
It All Comes down to Lighting
As mentioned, the problem ultimately can be distilled down to light. Without it we see no color at all. Changing the look of a light will change the look of everything the light is illuminating. Makes sense right? Of course it does!
Now let’s consider the default lighting setups for a handful of 3D painting applications.
When you create a MARI project four different lights are added around the asset. One in front, one in back and two up high on the sides. These lights are set with a white specular and diffuse color and fixed to the scene.
When you create a new scene in Mudbox a single white directional light is created at 80% intensity and is locked to your camera.
When you create a new 3D layer in Photoshop it will contain a single white infinite light illuminating the front of your mesh at 90%.
Are you seeing a theme here in these images? Defaulting lighting environments in texture painting applications are typically very simple and setup in a way so that your asset is illuminated fully from any angle. While this may be great for evenly distributing light so that all surfaces are easy to paint, it definitely isn’t going to be appropriate for most rendering scenarios. Nasty surprises in your texture can often be traced back to a mismatched lighting environment when the textures were painted.
Use an Image Based Light
The easiest solution that can be implemented in most cases is to modify the lighting in your texturing application to use an image based light. An image based light allows for a spherical HDR image, sometimes called a light probe to be and plugged in and used to provide lighting information. These are usually shot on set before hand where live action is mixed with CG.
By using an image based light, the colors you paint may look a little different but that’s normal. Depending on the image used they could change a little or they could change a lot. The important thing is that you now know how they will look after being lit and rendered in the scene they are intended for.
Adding an Image Based Light in Mudbox
When working in Mudbox, adding an image based light is rather easy. Just go to the Create menu under Lights and choose Image Based. Once the image based light has been added to your scene, make sure to select it and point it at the HDR image you're using in the Properties Window. Here you can also adjust its intensity and choose whether or not you want to lock it to the default camera.
Adding an Image Based Light in Photoshop
In Photoshop, adding an image based light is also very easy. With your 3D layer selected in the Layers Panel, select Environment from the 3D Panel. Next, take a look at the Properties Panel and you’ll notice an option to enable IBL or image based lighting. With this enabled, you’ll then need to click the small icon just to the right of the image preview and select Replace Texture. Photoshop uses it’s own image by default when IBL is enabled.
Adding an Image Based Light in MARI
Using image based lighting in MARI is actually a brand new feature at the time of this post with the introduction of MARI 2.6. MARI users rejoice! This environment light lives in the Lights Palette with the other lights and is completely customizable. The Foundry was even kind enough to include some HDR environments with the update so you can try it out.While the nastiness addressed in the post was primarily focused on discrepancies in the diffuse texture there is really all sorts of nastiness than can show up in your renders as a result of your textures. By using an accurate image based light, you'll at least know that the colors in your textures won’t change due to a drastic difference in the style of lighting that is applied to them. If you would like to learn more about using an image to light a 3D scene, make sure and check out Using HDR Images for 3D Lighting in Maya or dive in and start texturing with any of our training content in Mudbox, MARI or Photoshop.