Convert vertex color to a diffuse map.
- [Instructor] The user data nodes allow you to plug various forms of data into the Arnold shading network. In this case, we'll use the Ai user data color node to map the vertex colors in this terrain mesh into the base color of an Arnold standard surface. I've got a material already assigned to the terrain, but there's nothing plugged into its diffuse or base color channel currently. It does, however, have vertex color. If I select the terrain, I can go up into the Modeling menu set to Mesh Display and open up the Color Set Editor, just to see that I indeed have a color set embedded in this mesh.
And it's just got the default name colorSet1. And we're going to need that later, so remember that or write it down, colorSet1 with a capital S. We're going to close the color set editor and display the vertex color in the view port. With the terrain object still selected, open up the attribute editor with CTRL + A and in the mesh shape node, open up Mesh Component Display. And near the bottom, you'll see some color attributes.
Turn on Display Colors. But nothing changes in the view port, and that's because of a bit of a strange setting here. We have Display Color Channel, and it's a pull-down list. Paradoxically, from that pull-down list, we want to choose None for the color channel. And now we're able to see color set one in the view port. The reason we had to choose None here is because all of the other options expect to see textures applied to those shader attributes.
And if there were, for example, a diffuse map attached, then Maya would convert that bitmap or procedural texture into vertex colors. And that's exactly how I created this vertex color set in the first place. Okay, we want Display Color Channel set to none so that we can actually display color set one. While we're here in the mesh shape node, there's another setting we need to change in order for our shader network to operate.
Scroll down a little bit and open up the Arnold section. And down here, you'll have a section labeled Export. We just need to turn on the option to export vertex colors. And now the Arnold user data color node will be able to import the vertex colors. Now all that remains to be done is to apply the texture map. First, let's open up the Arnold render view. Go to Arnold, Render, and we can see what it looks like. It's just a gray-shaded landscape.
Let's select its shader node in the attribute editor. Click on the right-facing arrow until you see terrainLoFi_aiStandSurf and select that. And here's the base color and we'll just click on Create Render Node for the base color. In the Create Render Node dialogue, go to the Arnold section, to Utility, and click User Data. And these are all the different types of data that we can supply, and we want aiUserDataColor.
Click on that, and now we get black in our rendering because we have not supplied a string here in the attribute field. And now we just need to exactly type in the name of the color set, so click there and type in colorSet1. And now that color set is driving the base color of the Arnold standard surface material. And that's how to apply vertex color in a shading network in Arnold using the user data color node.
- Arnold rendering concepts
- Lighting with Maya and Arnold lights
- Controlling exposure
- Filtering light with Gobo
- Light attenuation with Decay
- Image-based lighting with Skydome
- Exterior daylight with Physical Sky
- Arnold Standard Surface material attributes
- Mapping material attributes
- Rendering refractions
- Mesh subdivision and displacement at render time
- Shading effects such as ambient occlusion and vertex color
- Camera effects such as fisheye and depth of field
- Animation image sequence rendering