Join Aaron F. Ross for an in-depth discussion in this video Render to Texture in 3ds Max, part of Advanced 3ds Max and Maya Integration.
- This chapter is all about setting up materials in order to transfer a scene from 3ds Max to Maya, or vice versa. The thing that you will have to come up against is that the FBX format does not support fancy materials such as procedural maps, or layered textures and things like that. This means if you want your textures to be transferred over, then you're going to have to bake them before you export to FBX.
Baking textures is similar to flattening a Photoshop document or rasterizing layers, it's basically, essentially rendering whatever procedural texture or fancy layered map you've got and outputting it just as a straight up bit map. That's the process we're gonna look at here in 3ds Max. To bake textures in 3ds Max, we use the Render to Texture dialog. But it's primarily designed to bake out lighting and all sorts of fancy stuff. We don't want that. All we want in this case is to bake out the materials flat shaded, not with any kind of lighting or other elements added in, like shadows for example.
When we have a scene like this, in order to use the render to texture dialog, we have to take a lot of steps in order to set it up so that it will actually give us the result that we want. If we're not baking out lighting, then we need to turn off some stuff. First of all, to avoid issues with material names clashing with each other, we want to make sure that each object in this scene has a separate material applied to it. On my artist mannequin here, I could have just one material, because it's using a 3d procedural texture, it's going to map all the objects differently.
But I can't actually have all one texture, I actually have to have a separate texture or separate material for each object. Let me open up the Material Editor just to show you that if I scroll down, you will see in the Scene Materials, I've got a separate material constructed for each object here. Ok, I've done that. Next we need to deal with all of our render settings. First of all, Gamma should be off when you're baking. You can go in to Customize Preferences, and the Gamma and LUT section, make sure that is turned off, otherwise you may contrast issues.
Next we want to actually make sure Exposure Control is off, too. Rendering Exposure Control, ok that's turned off as well. Next we need to choose our renderer and set it up appropriately. I'm currently using the mental ray renderer, this scene was from another course, 3ds Max 2015 Essential Training, in which we looked a little bit at lighting and rendering and mental ray. I've also got Final Gather turned on, which is a Global Illumination technique.
Those things are actually irrelevant to the baking textures process, but they will still slow it down. So we can turn all of that stuff off. Let's go in to the Render Setup dialog here. And if I wanted to bake textures using mental ray, then I would definitely want to turn off Final Gather. Under Global Illumination I would turn that off and any other fancy stuff I would try to mininize the amount of load on the renderer. But in this case actually, I can speed it up even more by completely ditching mental ray and going back to the standard Scanline renderer.
Go to the Common tab, scroll down to the bottom, and under Assign Renderer, for the Production renderer, I'll click here on this button to choose the default Scanline Renderer. And that's going to render these textures in seconds rather than minutes. Next I want to actually turn off all the lights in my scene. If all I'm doing is outputting the diffuse texture, and I'm not baking lighting, then I should not be rendering lighting. And the Render to Texture dialog will use whatever lighting is in your scene even if you don't need that.
To speed things up, I'll turn off all of the lights. Go to the Tools menu, and choose Light Lister. And then just switch everything off. And close the Light Lister. Now I've got no lighting in my scene. I'll go up here where it says Realistic and choose Shaded so I can see my scene once again. Alright, now I've got all of the conditions set up for baking, and I'll select an object. So i've got this little artist mannequin that's got a procedural wood texture on it.
I'll select his pelvis and then go to the Rendering menu and choose Render to Texture. And within here we have a lot of features, and a lot of power. However, if you're doing a simple job, like we're doing here, you're gonna have some challenges, because the dialog has got some internal inconsistencies and some issues that you'll have to work around. Namely, choosing the File Type is a bit problematic. I'll scroll down here, and you'll see File Name and Type, I can't actually choose a File Name and Type when I have multiple objects selected.
I have to choose my File Type with a single object, and then from then on, all subsequent selected objects will have that File Type. If I want to save out to a png for example, I have to actually tell 3ds Max that I'm using a png, with one object, and then from then on, all subsequent objects will have that format. Let's take a look at, up here, I have to choose where I'm gonna output to. And it's just gonna save into my Current Projects, scene assets images, as you can see.
That's good, that's what we want. Scrolling down, we've got our objects that we're gonna bake, keep going down, and you'll see Mapping Coordinates. If you've done a UV Layout on the objects, then you want to choose Using Existing Channel, and choose whichever map channel the UVs are on. I did not do a UV Layout for these objects, and so I need to automatically unwrap them. Ok so that's done. Then I need to add which elements I wish to render. In this case I'm only rendering the diffused channel. I'll click on Add and choose Diffuse Map, and click Add Elements, and now you will see it says pelvisDiffuseMap.tga, or targa.
I don't want to save out a targa document, I wanna save out pngs, those are much more convenient. I'll click on the Browse button here, it takes me to my current projects scene assets images. I just want to change the type from targa to png. And you'll see it still says tga here, don't worry, that's gonna get erased. When I click Save, I should be prompted to enter in whatever options for that particular file type, and I do want to just choose RGB 24 bit with no alpha.
Click Ok, and now you'll see it says, scene assets images pelvisDiffuseMap.png. We've got the right format, but we will get an error message now if we just try to render this, because it says scene assets images here, and it also says scene assets images up here. 3ds Max is going to try to save in to a folder that's called scene assets images scene assets images inside, and that folder doesn't exist. So we have to actually erase this here.
This is kind of crazy, but I have to erase this. Now it just says pelvisDiffuseMap.png. Ok. Next I want to select the rest of the objects. And then I can change all of their properties at once. I'll double click, and now I've got everything selected including the pelvis because all of those other objects were children of the pelvis. Then I wanna deselect the pelvis. If you're using Maya Mode interaction, then hold down control and click to deselect.
If you're using 3ds Max mode, hold down alt and click to deselect. Then we can go ahead an click Add over here again. Once again choose Diffuse Map, and Add Elements. And now you'll see up here, it says Diffuse Map, size 256, and Map Slot Diffuse Color. Ok, now we need to reselect everything again, so just double click on the pelvis, and what we need to see up here is, we don't want to see anything that says Varies.
We want to see for the Element Name Diffuse Map, we need to have a consistent size, and for Target Map Slot, it should say Diffuse Color. Now we can change the render size down here. Let's try 512 by 512. And it changed up here too. Scrolling down to the very bottom, we have options as far as what to do with the rendered files. Do we want to drop those into the existing shader network, and override the existing map? Or do we want to create what's called a shell material, which lets us toggle between two different materials within the same.
Well if we're outputting to FBX, we don't want to create a shell material, all we wanna do is, get rid of the existing procedural texture and replace it with the newly-generated bit maps. We wanna choose Output Into Source. And it's important that when you're done with this that you don't save the same file over itself, because you'll lose all of your fancy materials that you've built. When you're done, make sure you save to a new 3ds Max scene file name. Ok, so we should be in a good place now.
We can go down here and click Render. And we'll see a dialog go by, Flattening UVs, and now we see the rendered frame window, and it looks black, but that's because we've turned off all the lighting. In fact, It's working perfectly. Don't trust what you see in here, this is not the actual texture that's getting rendered out, this is all of the lighting, but we've turned off the lighting, so that's why that looks black. Close this, and then when we deselect, we can see that in fact we've got a nice texture on there.
Let's investigate this. Close the Render to Texture dialog, and I'll go out to the for viewport layout. If I'm using Maya Mode, I'll tap a spacebar, if using 3ds Max mode, it's alt + w. We can go ahead and select one of these guys, maximize that, and we can see that there are some green lines there, those are the UV seams on the object. We can check in on the material, go to the Material Editor.
And we can find out what material is on that object. Click the eyedropper, and then click the object, and here we've got mannequin, mannequin head material, and it's now connected to a bit map, where previously it was a procedural map. And we can continue to drill down into that, we can view the image, and there it is, that's our automatically generated baked texture. Additionally, we can check in on our project folder. Let's do that, I'll minimize 3ds Max, and you'll see inside Integration_3dsMaxProject, scene assets, images, we now have all of these auto-generated baked diffuse maps.
Very good. So finally, after having baked, we can now save our scene out to a new File Name. Save As, I'll call it Render to Texture Baked, that way if I need to go back to my procedural wood map, I always can. Ok, now our scene has bit map materials instead of procedural materials, and we won't get an error when trying to export with FBX.
- Managing and tracking assets
- Setting up a shared texture library
- Streamlining user interfaces
- Using Maya mode hotkeys in 3ds Max
- Harmonizing scene units and frame rates
- Rendering procedural textures to bitmaps
- Translating scenes with the FBX file format
- Correcting materials, lighting, and surfaces
- Using the Send To command
- Baking animation to keyframes
- Saving a geometry cache
- Distilling complex animation with Alembic