7/02/2012

mia_material_X: Creating metal


In the previous post I was talking about how exciting was to work in linear workflow using true HDR images for a physical accurate lighting set up and using the mia_material shader to get the most photorealistic result.
Well, I am still learning a lot of things and I don't feel really comfortable with this material, although I know it is great because I see work done with it and it is just amazing.
Now, we have to remember that this material is "doing a lot of thing for us". I am not saying that is going to adjust the parameters fo us but it is like its parameters are somehow connected so that they will always will look photo real.
And it also has a couple of features that can be a bit confusing, and one of the is the "Metal Material" check box.


I have been having a hard time this days trying to create good looking metal, and mainly it was because I didn't really know how to use  this material to create metal. 
I just connected my texture maps into the channel and then hit the Metal Material Check Box and render. But the results never convinced me. I was losing control in the way the material was reflecting the environment mainly.


What did cause the problem?
When we hit the "Metal Material Checkbox" the reflectivity and reflection color will depend on the diffuse color that we input. Meaning by that, if our diffuse color is very dark, our material will hardly reflect something. Try it out, set your diffuse to black and use the Metal Material feature. Even though the reflectivity is up to the maximum it won't reflect anything.









WHAT A FAIL!!!

Of course I wasn't using a completely black diffuse color for my metal, but I wanted to create a scratchy and grunchy looking metal, and the scratches in my texture map were very dark.
So by just using the diffuse map and using the metal material feature, my the reflectivity was being affected by this diffuse map, being not reflective in those areas with scratches.
What? Why is happening that? I didn't even use my spec map but is la if it was connected already.
This caused me a lot of headaches, although it makes sense and its a nice feature to use.
Conclusion to this problem: 
I we wanna create metal using the Metal Material built-in of the mia_materialX DON'T mess with he reflectivity slider of the material. Don't plug any map here, because the diffuse color will already take care of that, so use the reflectivity slider as a global parameter.
A good use of the spec map could be for the glossiness of the reflections, because probably the reflections on those scratches are gonna be more glossy(blurry and diffused)




Awesome! so we know how to play with this features. Let's take a look to the result of this Shader



Nice, it is looking somehow more metallic, the reflections are working as I expected (even though the reflectivity is set way up to 1 globally I have no direct reflections on those scratches)
So, I feel happy with this result, but I think it could look better. For some reason is looking way too dark, and it's gamma corrected correctly.
Probably my diffuse color is a bit low so it is not reflecting a lot of the environment. I could go to Photoshop and increase the luminosity of my texture, or I could even do it iside maya with the utility nodes and probably that would fix the darkness.
But I am not going to do that. Instead I am going to try a different way of creating metal, this time without using the feature "Metal Material"
First of all, lets think and study how metal looks (this weeks I have been obsessed with this topic, I was even picking up random pieces of metal that I founded ont he street, I'm pretty sure people that saw me will think I am a weird guy... In fact, I am!! XD just kidding)
So, how does metal look like? 
-it is very reflective, for sure, but the reflections are actually very blurred (unless the metal is super polished like chrome)

For this kind of effect people usually call it "specky" meaning that the specular highlights are very strong and this will cause the objects with this material to glow in a very beautiful way.
-It has cool scratches that are going to break the specular highlights making the material looking very interesting. Now, since I am not using the Metal Material checkbox, this time I DO want to contrly my reflectivity slider with a texture map, with white for highly reflective areas and black for almost matte areas (as I have being doing all this time)
-BRDF/Fresnel effect: this a very interesting effect that happens a lot in material like glass, where the edges will reflect more that its center. Well, in metal this effect almost doesn't happen, and the mia_materialX has a very contrasty BRDF parameters by default, so let's make sure that we bring the 0 degree reflection (core reflections) way up to almost the same value as the 90 degree reflection (edge) so that the material will reflect almost at the sam intensity in it's core and edge (which is physically correct in metals)
Don't forget!, metal kind of tints the reflections with the color of its diffuse, for example, gold reflections are warmish and yellow, so we are going to have to cheat a bit with the reflection color. But not too much, just a touch.
I decided to make my metal's reflection color a bit blue, just because I feel common metal has that cool tone (except of course for gold, brass, copper...)



So as you can see in the image above I am using the same maps as I was using before, but this time I am working the shader in a different way:
My spec map is going right to the reflectivity channels and controls which parts will reflect more environment and which ones will reflect less, so in this case the scratches won't reflect as much as the shiny parts of the metal.
I have the reflection color a bit tinted to blue, and probably that's the most physically incorrect way to do it, but I just like the way it looked.
I have no maps in the glossiness channel for a couple of reasons. The metal texture I am using is very simple in the sense that is not a combined material, like some color painted on top of metal with scratches that reveals different materials. This material is very plain and I don't have to use very complex maps. Plus, my reflection Map is very dark in the scratches so I don't have to worry about level of glossiness there because basically there is no direct reflection in those areas, so no matter what changes I make in the glossiness, the scratches will look the same. So here the glossines will affect globally the shiny parts of this metal. If I were working on a more complex material with different levels of glossiness I would use a black and white map to determine what parts of the material are more like a mirror (white glossy value) and which ones would look more blurred and diffused (darker glossy value)
So with all of those parameters set like that and a good lighting set up my render looks something like this. 












And I might be wrong, but that looks like metal to me even though I am not using the Metal Material option.


I am not saying that the Metal Material option doesn't work, it actually works very well and does its job, but sometimes it can be confusing and you have to make sure that you are using the correct diffuse color map, because it is basically going to influence most of the other parameters, specially the reflectivity ones, which are the most important to create realistic metal, I think.


Also, I would use the metal material option ONLY for objects with plain materials, like coins, pieces of hardware, in general when metal is "naked".
Just for a simple reason, let's take a look to the images below:






this object has various elements: the main body has a complex layered material with a metallic base
and paint on top. I also has other components like the button, screws and that chromy thing around it made of  a more simple and plain material with different levels of glossiness.
the door of this car has some damage revealing the metallic surface under the paint.


A nice texture of peeling paint revealing the metal beneath it

This materials are way more complex because they are combined, so their parameters are going to be very different. The question is, should I use the Metal Material option if I am going to recreate any of this cases in CG?
If I did that using the texture above the specular highlights would be tinted in yellow making the paint looking like gold, so that would be wrong, but... Wait!!!! There is metal underneath, What should I do?

Using the mia_materialX has changed the way I do my models. Now I try to model pieces thinking about what materials are going to have so I will avoid complex shading nightmares, and I like it because that makes me do my models more detailed so I gain quality and improve my modeling skills.
But I am NOT going to model scratches, no way! that would be crazy. Instead I would try to get a nice looking metal playing without the Metal material option and doing my best.



So with things like this I reach a conclusion about the mia_materialX.
It is a great material and I love it when I have to deal with simple materials and almost no texture maps,
but it has it's limitations when you want to use features like Metal Material or Highlights Only.
because with this material you have the option of skip the calculation of extremely glossy (blurred) reflections (which) are very expensive to render if you want nice quality, by just turning on the "Highlights Only" button. This will reflect only the highlights, is great again for plain materials.
But what if I want to render the surface of a military vehicle which has super glossy reflections, with some scratches revealing metal underneath? Should I turn Metal Material and Highlights only?
That way that paint would look like metal when is more of a matte finish, and the metal wouldn't look correctly since would reflect only the highlights instead of the whole environment. It would just look odd. 



Ok enough about the topic!
That was a long post, but really, I have been obsessed with this topic for so long and I just wanted to share my thoughts.
I never started this blog to post this kind of information. I just wanted to put my projects and WIPs here to show it to people and have some kind of portfolio. But right now I am a young CG and VFX artist and there are so many things I need to learn so I am doing a lot of Look Dev stuff to make sure I understand how the tools work before I start doing crazy projects, but soon I will start bringing something new here. In fact I already started working on a couple of small personal projects on my free time :P


So for people how read this, I hope they found it interesting and informative. I you know answers to my questions and doubts, or if you just think I am doing this in a wrong way please leave a comment and show me different ways to do it. I would love to learn from others opinions and research.

And talking about research, I should mention one site or Blog rather that really helps me to understand how shaders work in CG and how materials react to light in real life.
His name is Master Zap, he works for Mental Images, the developers of Mental Ray render engine, and in my opinion he is one of the best giving tips about all of this topics.

You can go visit his Blog here


So hopefully next post will be about some WIP of my current personal projects and less Look Dev!
Thanks for visiting my blog.

See ya!



1 comment:

  1. hey Pedro , thanks a lot to share your studies , very cool explanation.
    regards
    wev

    ReplyDelete