Sunday, September 28, 2014

Cool off with a refreshing beverage

The third and final item in our Visual Development texturing project is a glass bottle with a drink inside. This builds a lot off of what we learned with the box from the previous post but also introduces a lot of new concepts that are unique to glass and liquids. For the glass the layering of the texture is very similar to the box but instead of a bump layer we have a transparency layer (There is a bump in the material but it is a simple overlay which does not need a full layered texture.) Remember to keep in mind that black is 0 and white is 1 when working with the transparency and reflections. The label should not be transparent or reflective since we are going for a paper look, and the bottle should be transparent and reflective to give the look of glass. The fingerprints on the glass should be somewhere in the middle because they aren't completely see through or solid (Think of this as the blood from the last project.)


To get the glass to look more like glass there also needs to be some changes in the material itself. Big players in making this look right is the Index of Refraction being set to 1.52 (the value for glass, every existing material has a unique index of refraction.) And The BRDF being set to use Fresnel Reflections (this will pull information from the Index of Refraction.) Also once you get a glass that you like, save a preset, what's to stop you from using it again in the future when you need a place to start on some glass, it can only speed up your workflow, and it may come in handy later in this project too. Let's see how our bottle is looking so far.


I should probably note that I made the texture in photoshop as well as the bump, if you end up trying this, make it as outlandish and fun as you'd like. Now we have to fill it up, no fluids or anything like that, the liquid will just be another piece of geometry with some attribute changes. In fact you can just take that glass preset from earlier and change the "Color at Max Distance" value under the Advanced Refraction attribute and the index of refraction to 1.38.

Next is the caustics which is a special type of glow that certain materials give off when hit by light. Many sodas have this in the real world, so to make this look realistic we should add it too. This is done by creating a spot light that is in the same location as the key light, and in the mental ray section of the light attributes, checking the emit photons box and changing the photon intensity (Mine was 8000000, but it may very depending on the project, just know that this value will probably get really high.) Also while you work on caustics turn the bottle visibility off so it only effects the drink, and make sure you have some specific caustic render settings turned on. Once you get the results you want, turn off Rebuild Photon Map so it saves your desired result.

The finishing touch are the bubbles which are just polygon spheres with the soda material applied to them. I switched the Color at max Distance back from orange to white, but other than that, everything stayed the same. This is what I came up with. 


In the end it all comes together, looking at it again though, the caustics could be a bit darker to match the drink more, but I did learn a lot from this and now also have some valuable presets I can use in the future.

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.

Tuesday, September 23, 2014

Creating UV maps and Photoshop texturing

For the past few lessons in Visual Development we have been working on an ongoing project that covers UVing, texturing, diffuse, reflections, caustics, projections, and other concepts. We used a simple scene with a few different props, each with different materials that would react differently to light, to showcase these concepts.

First was the scraper. With the scraper I reenforced some UV and texturing concepts that I've known for a while now, but haven't really used that much. The model was provided to us but had a default UV map which is unusable when applying a texture to it. More often then not, when making textures for models, I would use automatic mapping and be done with it, if textures were not the main focus of the project. Working on this scraper has shown me how important it is to manually make UVs and how easy it makes your life when texturing in Photoshop (A quick tip to make sure your texture wont be stretched later is applying a checker pattern to the geometry to make sure the UVs are making perfect squares.)

scraper without texture
A new workflow technique I learned with this project is a very useful UV layout one. When laying out UVs in 0 to 1 space you do not need to make your layout a perfect square (sometimes a rectangle can be more efficient.) The picture below shows that you can layout UVs in the 0 to .5 space without any distortion, but before you save the UV snapshot scale them up to fit 0 to 1 and save it 2056x1028 instead of 2056x2056 (or any other numbers as long as they are the same aspect ratio.)

converting 0 to .5 into 0 to 1 space
Doing this will create a nice clean UV snapshot that is easy to follow and make an effective texture, while also using as much of the UV space as possible. With a perfect square, the three big pieces would be hard to layout without a bunch of dead space that will only go to waist. Speaking of an efficient layout, the tiny pieces in the holes of the handle are parts of the UVs that are never seen in any camera angle, they are covered by other geometry. Because of this I just scaled them very small and tossed them in an area I wasn't using, to make room for the UVs that were more important.

scraper UV texture map with an effective layout
Now that we have an effective UV snapshot, all that's left is creating the texture in photoshop, which with the reference images provided was not to hard.

REFERENCE
This is what I came up with. I just used standard Photoshop workflow, like masks and transform tools. I also painted out the specular highlights because they will be added later in Maya.


I really do enjoy UVing in Maya and making textures in Photoshop. Next time we'll look at projections in Maya and adding details without making a full texture.

Tuesday, September 9, 2014

Visual Development - Lighting & Mental Ray 2


With the second part of the lighting project, we built upon the same scene from before and added more lights as well as an IBL (image based lighting.) We had a new reference to match and it took a bit more effort to match this one because of the variety of new light attributes and the high render settings towards the end really slowed down the renders. There is also a concept we learned that is a lot to take in. It is called Linear Workflow and I would like to give it its own post because it is really important and really interesting.


The biggest challenge in this project was the grain I was getting in the render as well as the slight muddiness that is visible around the top of the door frame. Bumping up the render settings only took it so far, I decided to cap off the settings when the render times became well over 10 min. (a frame!)

Some new lights I learned about from this project was portal light and physical light, which are mental ray lights that accept information from the IBL. This allows for some very quick realistic lighting that has the potential to look really nice if the IBL is good enough.

From this project I learned a lot about how maya treats lighting and how they are rendered through mental ray. I was surprised by how interesting and deep lighting can be and how I can further improve other projects with it. See you soon.

Motion Capture - The Basics

Motion Capture has been a really interesting and efficient way to get realistic animation as long as you know how to manage and clean up the results.

The program Cortex is a very efficient way to clean up all those markers from the mocap data. Most likely all the cameras in the capture volume haven't caught all of the markers on the suit 100% of the time. That's where Cortex comes in to fill in the blanks. This is also where you want to name, organize, and link your markers. A unique feature in Cortex is that there are two different save files you work with, project files and track files. Projects are the environment or capture volume, This will save the number of cameras, volume size, and things of that nature. Track files are the marker data that you captured and edited, this is where you will see the motion (overall, you will probably have more track files than project files). Another important aspect to know about motion capture is that you want to get a t-pose of your capture subject to have a default pose to reference.

After finishing in Cortex it's time to go to MotionBuilder (Mobu). When first opening Mobu it'll ask you for a preferred control style. I chose Maya because that is the control style I'm used to. A lot of Mobu's interface is already reminiscent of Maya, both being Autodesk programs, in fact if you have used the human IK in Maya, a bit of Mobu may be familiar to you. The reason Mobu is a part of the motion capture pipeline is that you use it to further clean up the motion, assign geometry to the your capture markers, and export one simple file for use in Maya. Below is a moving car that was animated using motion capture markers on an RC car. Using a solid object is a good way to learn the programs and controls because you don't have to worry about the complexity that goes into, say a human, but you still use many of the techniques that are necessary for all types of capture subjects.


Speaking of a more complex capture subject, a human takes just a bit more extra steps than the car. When you create the marker links in Cortex for the car, there are only 5 markers to link to one another, which goes really fast, but with the human there are 49 markers, so you need to manage the links to create and efficient and easy to manage skeleton.

Another big difference is that when capturing the motions of the animation in the capture studio, you need to make an additional take or the range of motion (ROM) that covers all the range and possibilities that your character will make. This ROM also needs to be touched up in Cortex, just like the t-pose and final movement.

In Mobu the geometry takes a little bit more effort to bind than the car because certain sections of markers go to certain parts of the geometry. This was the final result in Maya.


The animation is far from perfect but it is a good base that can be further improved with a few strategies that I will cover in the next mocap update.

Saturday, September 6, 2014

Visual Development - Lighting & Mental Ray 1


The first step in Visual Development is learning what lights do and how they cast shadows and how to set up some standard render settings in mental ray.

We were given an reference image and had to match it as closely as possible by adding lights and adjusting their settings as well as the render settings. All the geometry was given to us because the main focus was nailing the lighting.

darn gif artifacting
I used two lights when recreating the scene, a directional light and a mental ray area light. The directional light is supposed to emulate the sun coming through the window. The general position of this light isn't very important because it is just a wall of light coming from one direction. What really matters is the rotation, this needs to be spot on to get the placement of the shadows just right.

On the other hand, the rotation of the area light is not very important, but the position and even scale is. With a normal area light, rotation would matter because it is a flat plane, but with the mental ray area light set to a sphere shape it does not matter because light is emitted evenly in all directions. This is used to emulate the effect of a lightbulb.

default maya area light
spherical mental ray area light
Like I previously mentioned, the scale on the mental ray area light matters because that effects the softness of the shadows. The softness of directional light shadows can be changed with the raytrace settings in the attribute editor.

The bottle took some extra work because it is supposed to look like glass and refract light appropriately, which by default it does not.

not bending light correctly
To fix this, the raytrace options for reflections and refractions under the render settings must be changed to account for all the surfaces that the light travels through (which for this glass is 4) and add 1 or 2 more to be safe (The Max Trace Depth is the reflections and refractions added together).

This project was a great way to get back into the workflow of shading and lighting and understand some concepts I haven't really applied since I first learned them.

Motion Capture and Visual Development

This month I started two new classes, one of which is very new material and one is a refresher and expansion of a class I took months ago.

In mocap, there are two new programs to learn, Cortex and MotionBuilder. These are used to clean up the motion capture footage and make it ready to use in Maya. All the skills we learn throughout the month are building up to a final group project that takes place throughout the whole month. That consists of making a 40 second animation using mocaped footage. 

Visual Development seems to be a continuation of Shading and Lighting. Here we are learning how to properly set up lighting in Maya. This includes lights, rendering, texturing, shaders, and compositing.

Each class has unique projects that help us apply the concepts and I'll be posting some of those as they happen.

I am really excited to build up my skills this month and share them with all of you.