Blog

Setting up colored metals in mental ray

Impostazione di metalli colorati in mental ray

Finally i'm back after a long time of silence due to months of hard work. The topic that I will discuss in this blog post is the creation of colored metals in mental ray, specifically, using the mia_material_x shader.

The same general concepts can be used even for other shaders and render engines.

The workflow for the generic creations of metals is explained very well in this article by Master Zap.
In a nutshell you have to activate fresnel reflection in the BRDF section of the material and raise the Index of Refraction value to between 10 and 50 depending on the type of metal that is needed.

The principle behind the creations of colored metals, like copper or bronze, is that in these types of materials, the reflections tend to assume the same color of the diffusion component that we assigned to the shader.

In the attribute editor of the material there is an option, Metal Material, that allows to obtain this effect automatically.

image of the Metal Material attribute

The Metal Material attribute of the mia_material

While this solution works perfectly with very lightly colored metals, I have observed that it tends to give non-realistic results with dark colored metals.

As we can see from these reference images, it frequently occurs that dark colored metals have strong reflections.

example image of a dark metal example image of a dark metal

Some images of dark metals

Let's start to set the material.
We create a shader that only has the diffuse color attributes set, a dark ocher similar to brass. The result is represented in the following image.

image of the shader with only the diffuse channel active

The shader with only the diffuse channel active to define the color of the metal

Now let's activate the reflections with the Metal Material option selected. The result is not good due to the excessive darkness of the reflections.

metal set with the metal material attribute

Shader set with the Metal Material attribute

This is the consequence of the fact that the Diffuse Color is copied in the Reflection Color slot and if this is dark the intensity of the reflection will obviously be very low.

How can we correct this behavior?

First of all let's deactivate the Metal Material attribute.

metal set without the metal material attribute

Mia_material set without the Metal Material attribute. We cannot see the color of the metal anymore.

The metal gets back it's reflections but these are not colored, a behavior that is similar to dielectric materials rather than metals.

So, we have to manually set the Reflection Color attribute to a color with the same tone as the Diffuse Color but much lighter. There is no scientific way of doing this, personally I do some test renders of the material to calibrate it correctly possibly with mental ray's progressive mode. As a first step we can set the same color that we have set in the diffuse but without the gamma correction.

metal with the correct reflections color

Mia_material set with the correct reflection color.

The process is the same even for shaders that have a texture.
We insert the diffuse texture in the Color slot of the Diffuse section of the mia_material and we set a constant color that preserves the general tone of the diffusion texture in the Reflection Color.

Now we insert the texture in the Reflectivity or Glossiness slot to vary the reflections based on our needs.

The only thing that you need to pay attention to while setting this texture up is that you don't have to correct the gamma because those are not interpreted as colors but as values.

Finally remember to activate the Alpha Is Luminance attribute in the Color Balance section of the file node, because these slots read the alpha channel of the textures not the RGB channel.

Happy rendering!

Paolo Mazzoccato, fondatore Fisheye Studio

Paolo Mazzoccato

Founder of Fisheye Studio and computer graphics addicted since 1996. When tecnology let's me down I find comfort in my cats' purrs.

Linkedin

comments powered by Disqus