Sunday, September 28, 2014

Projections & layered textures in Maya

A few days ago when I covered the texturing of the scraper, that was done in Photoshop, this time around, for this box texture I'll talk a bit more about what you can do in Maya to enhance your textures without making an entirely new one in Photoshop. This is done with projections and the goal of this project was to get a sticker and a blood or dirt effect on a box, while still retaining the proper bump and reflection properties on each different type of material. This is done by using layered textures and isolating certain sections with alphas. When working with layered textures and a variety of different types of materials on the same Maya material, things can get pretty hectic and confusing but it is important to take the layers one by one and know exactly what you want the final product to look like, because that is how you'll be able to appropriately assign values to certain attributes quickly and effectively.

The more materials, the more managing

One very valuable piece of information that will really help in a project like this is that Maya reads the color black like 0, or not effected or off, and white like 1, or on. So for example if in a reflectivity map, areas that are black will not be reflective, white areas will be 100% reflective, and gray areas will be somewhere in between. 

So what is all that stuff in the hypershade picture above? Those are the different material layers (box, sticker and blood) feeding into the final Maya material that is going to be seen in the render. As a side note, I'm using a "mia material x passes" as my material, this is because later I will be rendering out in passes but many other materials can get you a similar effect. I also used a surface shader while I was working just to test certain things out because they render much faster, but don't forget to switch that out in the end because surface shaders don't have reflectivity.

To get started you simply want to begin with the diffuse layers, those are just the plain colors and what you see, minus reflection and bump. This is where you set up the majority of the connections, because you need the sticker to have the proper alpha to be overlaid on the box, and same goes for the blood. The gamma corrects are there because we are using something called linear workflow, which you may or may not use depending on the project. We are basically compensating for the computer monitor's inherent gamma correction (I will get to covering this in its own post soon.) Anyways, here's how the hypershade looks like now.


Notice how it doesn't look much different from the final one, only missing the bump and reflection layers, that is because those pull data from the nodes we've already created, we just have to make the proper connections. The hardest part has been done. Here's what we have so far in the render with just diffuse.


There's a working box texture with a working sticker and a working blood effect, which is great so far based on what we have in the hypershade. Just don't forget if you get stuck up at this point, the blood and sticker both need working alphas, so if you get the images off of the internet, they most likely won't have that, so that just means going into Photoshop and making them separately. Also don't forget to put your layered texture into the diffuse color attribute of your Maya material to see the changes on your geometry.

Next is the reflectivity layer which is no trouble at all since we have many of the connections already made. This short video shows all the steps it takes to turn your diffuse layer into a reflection layer.


All you really need to do is duplicate your diffuse layered texture with connections and then break the color connections on each layer, keep the alpha information though because that's how the reflectivity will be isolated to certain sections. Then you want to apply that information i mentioned earlier about black being 0 and white being 1. The box layer was set to 0 because it has 0 reflectivity, the sticker is set around 50% grey for some reflectivity, and the blood is only slightly reflective not even really enough to be seen in this particular render. Also don't forget to check Alpha is Luminance on the new reflection layered texture because having it off will not yield desired results, A rule of thumb if you are not sure about checking that box just keep it checked. This is the new result, the only major change is the sticker getting a reflection, but we were able to manipulate it uniquely without messing up anything else, which is the true beauty of this workflow.


Again, not much different, but it's the subtle changes that start to ground it in reality. So let's add the final step, the bump map. This network has a few minor changes but you can basically follow the steps of the reflection layer to get there, the main difference the colors of the layers will be different because we are trying to effect different areas.


This time instead of making the box layer black, you want to connect a bump file into the color attribute (This is a black and white image that will dictate where the surface will raise and where it will not.) The sticker will have just a very subtle bump because it is on top of the box and same goes for the blood. You may also need to mess with the overall bump once you make the connection because Maya's default bump of 1 is pretty extreme for most projects. Here is the final result. I also turned up some render settings so you'll notice there isn't as much artifacting in the sticker's reflection.


Now that it's done, you may be wondering about the practicality of this workflow as opposed to just making separate textures for different boxes. This method takes some thought and time to make the initial connections, but once you have this material set up, you can easily save it and pull it up when texturing many boxes, all you need to do is change the file texture of the sticker and you can easily have a dozen boxes that all look unique, with minimal effort. Another use for this method is if you are making models of athletes with the same jersey, the only difference being the number on the back, in that case the number would be the sticker and the jersey would be the box, you can make as many unique jerseys as you need in no time. Or switch out the athletes for soldiers, they may have the same uniform but different accolades and badges, just turn those into projections, and with the layered texture you can even alter their shininess just like the sticker here. You can even just use projections to break up a boring repeating texture of a brick wall by adding some graffiti or moss to make it look more lifelike. This type of workflow has a lot of different advantages and I'm really glad I got a chance to learn about it.

No comments:

Post a Comment