How-To: Reflective surfaces

Reflective surfaces are tricky, to say the least. What makes them so tricky is, unless you are looking at a truly reflective surface or a truly matte surface with no specularity, all surfaces change reflectivity based on the angle you are viewing them at. If you don’t believe me, go find a puddle and start at about 20 feet away and slowly walk up to it. See the change in reflectivity? Still don’t believe me? Go find a polished metal, look at it from a glancing angle all the way to looking directly on it. Those are the easiest to see, but every object has it. I want to make a quick note, no object in this world is 100% reflective at ALL angles. Chrome is super reflective, especially at glancing angles, but it is NOT completely reflective. The preset for chrome in material_x even says so, the real world also says so, and I say so!

For anyone that has ever used mia_material_x this is phenomena is found under the BRDF section. BRDF is wonderful if you are using material X, but as most people don’t use it, I thought I would write out a mini-tutorial on how to fake BRDF in non-mia materials. Keep in mind ultimately for any shader based on life, you want to study that real world material completely. You have to be that guy or gal that is staring way too intently at a wall or object(it is more fun that way anyhow) in order to ultimately get it right. The closer you look, the more you pay attention, the better your shader is going to be.

So, as to my mini-tutorial, we are going to be using 4 whole nodes in this shader network. In actuality you only need 2, but 1 is for artistic control and the other is considered better technique. So here is the basic network:
So that is the basics of it. The multiply is the node that you may want in there to add extra artistic control, though at the end of the day it is not necessary and costs a bit in render time(it would be microscopic but optimizing is optimizing.) The other node you don’t necessarily need is the luminance node. You can easily pass one channel of the outValue to the last connection. Just keep in mind that if you have color in the ramp instead of a gray scale ramp you will be dealing with only one channel of the final color and they will be different. The luminance node simply flattens out the 3 channels to one. Again this extra node will cost extra in rendering time(still very small added time), but it makes it easier for others to follow the shader.

If you have ever read a tutorial on how to make a velvet shader you should notice they are almost entirely the same, except instead of dealing with a ramp as a way to store and blend between colors we are using it as a way to blend values. If you think about it, at the end of the day a color is made up of a percentage of Red, Green and Blue. In this way we can store data in a new and visually intuitive way. I have never seen the data that a sampler info node gives, but I can only assume, based on its interaction with ramps, that it returns a normalized value going from looking directly at an object to looking at the most extreme glancing angle, or 1 to 0 respectively.

In the ramp node we put the value of the looking directly on an object at the top, this should be your lower value of reflectivity. Inversely the value for reflectivity at a glancing angle should be at the bottom. I like using the ramp in this way as you can much more intuitively see what is going on with data, rather than material_X’s BRDF slider. Below is the final render with material_X and a Blinn:

Material_X is on the left and Blinn is on the right. As you can tell they are not EXACTLY the same in terms of reflection, but it has been a while since I have used material_X and I forget all the ways that it interacts with other values. In terms of being straight forward to follow and having a straight path to what values are doing what, Blinn wins. It may not be as physically accurate but it is much simpler to use the method above. Especially for TD’s to give to shading artists in a professional setting. I am a heavy believer in giving simple to use artistic controls to artists.

Keep in mind any material, even one we perceive as matte, has some kind of molecularity and reflectivity, using reflectivity that changes with facing ratio will tremendously add to the believability of an object. That’s what we are all about isn’t it?

Comment Pages

There are 5 Comments to "How-To: Reflective surfaces"

  • why do you need the 2D placement node? what does it connect to? Also shouldn’t you also have this facing ratio modify the specularity since reflectivity and spec are basically simulating the same thing in different ways. Oh, and W00T F1$T P0$T!!!1 0N UR BLAG.

  • I did some more looking and I’m not the first post. :-(

  • As to the 2D placement node, that comes with the ramp for free, it is the standard connections to the ramp node since it is a 2D texture.

    As far as the specularity question I can’t say, I have never formally looked for that. You should always look to your reference and try to match that. I don’t want to give you bad information, especially since I don’t know the answer myself.

  • Zahari Dichev says:

    great stuff man :) Actually under the hod that is almost exactly what the mia shader does with the reflections. it just uses a little more advanced math for the decay. Anyway this is really helpful stuff, though I would always use mia material simply becaosue it is the most phisically accurate shading model right now avaible for mental ray and… ofcourse is… optimised to work with linear light

  • True, the major point of this post was to get people to understand how to do this without having to use the mia shader. Any form of those shaders are wonderful, but dense to understand for those starting out. Another reason for this post was the fact that many people don’t use mentalRay or studios don’t use it. It is always nice to know how to replicate this stuff without using something pre-built.

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>