Unlocked RGB Exponent.

Yeah it’s a tough one - what happens with metals is that they have a different reflectance curve for each wavelength of the spectrum which can cause some splitting of the colours - it’s mainly visible as a shift in colour cast over the gradual change in angle of the surface so it’d be similar to using a different falloff map in red, green and blue and then recombining them to make the final map. Glossiness is a function of surface roughness rather than a wavelength thing so I can half see why you might get that visible effect but it seems too localized around the speculars on fairly flat areas for it to be angle / wavelength based. In the iron man example above it looks like it’s split around the highlights which makes me suspect something else might be at work. I don’t know all the terminology for this so I’m at a loss as to what to search for specifically but the most frequent place I see this effect is on vehicle parts that’ve been treated to prevent oxidization and it’s the coating that’s put on the metal that causes the coloured fringing due to it refracting wavelengths of light differently.

Here’s a really trashy example using different falloffs for red, green and blue as you get on metals and it’s not really what you’re going for. Your effect seems more like a car paint type spec effect with multiple layers of coating that filter light differently. Not arguing with you at all about the look of what you’re going for btw or how to get it, just more so what’s causing it.

For all of the metals it’s a tough one - We can get wavelength data for a lot of different types of metals but the bad thing is they come from scan data. This is really handy if you want that exact look of the sample of the metal that was scanned, but if you want something rougher, or more dirty or more oxidised or whatever then it’s less useful - the scan data is exactly a replica of the reflectance of the bit of metal put into the scanner, so it’s not very flexible. Hence we come to the artistic approach to it of getting something that looks right to us instead which is probably way more useful.

Just as a quick example here’s some fresnel curves tweaked to give a bit of chroma splitting but it won’t give me the effect you’re going for above, and you’re totally right, the fastest way to get the look is independent controls over r,g and b glossiness - physically incorrect but again who cares since we don’t totally care about how we arrive at the final pixels once we get the look we want.


And a wee 2012 file for anyone curious - https://dl.dropboxusercontent.com/u/575602/Ugly\_metal\_reflections.max

P.s. gorgeous work on your site - I’ll be buying your support stuff for the materials, I’m always interested in approaches to calibration and measuring of materials in known environments to get more predictable results!

This is exactly the approach I’ve been taking with the layered RGB model, however I hadn’t thought of simplifying the approach with bump maps!
here is the result!

Great to see others with similar interests! I’m on the exact same page as you and would just like an artist friendly approach :slight_smile:

I’ve got some code that will take the reflection scan data from a metal and convert it into a gradient ramp which you can then use in mapped mode with a perpendicular / parallel falloff driving it so we can get accurate reflections as per refractiveindex.info but again it’s scan data from one specific very clean ideal sample of the metal and the end result may not look like what you want or imagined - I don’t think there’s all that much benefit in sticking it up when it’s so limited but I’ll do a run through of reflections some point very soon. Just as an aside the head of 3d commercials in framestore london was what led me to it - he did a course for fxphd called mya214 - it’s a maya / mental ray course but it’s the first thing I’ve seen that really goes through calibrating hdris with mac beths, sample shaders and so on - he also goes through the metal reflection process and all the hoops you’ve to jump through and whether it’s ultimately worth it or not. Good course!

As I say very interested to learn about your approach - your results speak for themselves!

grantwarwick,

your tests,specially the metal look very interesting, would you mind sharing the metal example material?

I’d love to see some example of what the curves look like once reconstructed, sounds amazing as it gives you the push in the right direction then you can alter to match further.

Not just yet sorry, I’m planning on releasing my production shader library as a bought package. I have a thread in the general forum showing what I’m up to.

Sure thing - I’ll pop some across. One thing that’s slightly annoying is that max doesn’t have script access to creating the swatches on a gradient ramp. It can alter them if they exist, but not create them and so you need to have a starting gradient as a base to alter.

The general result of the curves is that you have a fairly reflective curve (above 50% generally) for the majority of the angles from 0 to 50 degrees, then they start to make a ramp up towards 100% at the very edges. Each metal has a colour cast though so it means that the red might be flat at 55%, green at 45% and blue at 60% for the 0 to 50 degree portion. It makes a difference at your edges but again depending on what the curvature of your object is it may or may not be worth the effort. The other things is that the setup is driven by a formula and outputs a gradient, and since each of the r,g,b curves get merged into a key for each degree value it’s less elegant to edit afterwards. I’ll look into other options, things like bercon gradient has maxscript access but it’s not included with max or vray unfortunately - I’d love to find something that works out of the box.

Can you explain the difference on the refractiveindex.info site of the S-polarized, P-Polarized and Non Polarized reflectence curves?

I struggle to understand the math/science behind it however have a pretty good eye at reproducing the correct reflectance nesting fresnel layers together in a blend material.
The problem with my approach however is the shaders are more complex than they should be and if I knew what reflectance graph to copy I could essentially make the gradient myself.

Thanks for your help and insight!

Edit- So some googling reveals its just an average of the two curves and commonly approximated in computer graphics. Am I right in assuming these 3 curves have nothing to do with the RGB reflectance values?

Yep - S polarized and P polarized are just two methods of measuring and we take the average of the two as what we consider the “visible” part of it that we want for our reflectivity percent. In some ways it’s a dumb move by the site author as using red green and blue can be confusing.

All you do is go to that site and stick in the following values for your wavelengths: Red 0.650, Green 0.510 and Blue 0.475 into the wavelength type in at the top of the chart. Then scroll to the bottom where it shows the reflectance curves for for s, p and non polarized. This’ll give you a visual diagram of how the reflectance of the metal is mapped from 0 to 90 degrees for each of the red, green and blue wavelengths - bit of a pain to do it separately but that’s about it. It’s a shame that the falloff map doesn’t give you a type in position and value for each knot you put onto the curve as it’d make it really easy to get accurate results - as you say though you just have to trace that curve for red, green and blue, then combine them together to make your complete reflectance curve. You can use three of these in perpendicular / parallel mode with your curves (since the graphs are even from 0 to 90 - each value on the curve is a degree so it’s mappable to perp / parallel) and then put them all into a composite map with all three in additive mode to add up to your “white light” reflectance value.

It all of a sudden starts to make amazing sense hahaha.

I’m wiling to put the effort int to reproduce the materials, just wanted to make sure it was done right.

Maybe my brain is exhausted but I want to believe that using this composite map method to create the reflectance curve will produce the same fringing we see in my test but I have a feeling it won’t?
Basically my metal material seen on the previous page blends 3 different materials based on RGB each having a slightly different fresnel value so it’s basically the same as what you are describing on a larger material level (Calculating 3 materials is slow as shit)

Heading into work at 5am to experiment time!

going to look into using this over the composite map for simplicity’s sake

Why not. I’ll fire over a copy of the script and a preset gradient for you to have a look at and see if you get similar results.

Thanks heaps,
I’ll share the results here!

Sent a pm - I don’t think it’ll make a massive difference right now or let you get that nice chroma spread on the spec - you can make a bit of a fringe on one side but not on the other alas. (unless you want to do some evil shadow / light falloff map stuff and sacrifice the reflections purely to get that highlight)

After taking a look at the script and scene setup, is it not possible to control the gradient by simply matching the bezier curves in the output rollout set to RGB mode?

Yep it probably is - I didn’t get a chance to check it and do a quick a / b comparison between the two but this should work fine!

Would be really handy to pop out that gradient dialogue, pain in the ass having it so small :confused:

I made some decent progress today, that red shader you saw in the other thread is using a modified gradient you supplied!
I got it to match the Iron Man Mark 3 suit very closely.

While we are on the subject of metal. Does anybody know how to get the physical diffuse information? And does it also have an IOR Value?
I’ve seen others experiment with polarised textures to get the values but Vlado used a different approach on his leaf tutorial.

For my shaders sometimes I use fresnel in the diffuse and other times not, always by eye though as I don’t understand the physics.

Ah yes. This is a very handy thing that a poster called rens on the forum explained to me. Metal has no diffuse at all and the scan data you have in those curves is the total amount of light reflected from the surface - diffuse, spec and reflection all at the same time - so if the curve is 60% reflective at the front facing parts, then only 60% of the light that hits the metal bounces back full stop - the rest is likely absorbed. What happens to differentiate between diffuse and mirrored metals is nothing but surface glossiness / polish / focus. If you were to have a really, really rough metal like a material you set the glossiness to 0 for, it’d end up looking like a simple diffuse shader, albeit at incredibly wasteful sampling times.

Metal has no IOR at all - I think the distinction might come with the difference between conductors and dielectric materials - dielectrics are pretty much all non conductive materials, or all non metals. They’ve got a very strong fresnel effect as we understand it in vray terms, metals on the other hand use a complex ior which is the equation I sent over which we can’t simulate with the current material settings. Here’s a comparison - Fresnel Reflectance

So pretty much ignore fresnel when you’re doing metals - there is a tiny bit of a curve in most metals but again we don’t have separate ior values for red, green and blue and with the current settings in the material you wouldn’t be able to make the correct curve anyway - putting in high numbers in the ior causes the reflections to be quite strong for most of the facing angles, and then they take a huge dive down as they go toward the edge before shooting up again to 100% reflective. What’d be more useful in terms of a fake is having a 0 degree reflectance %, a 90 degree reflectance % and then a mid point curve control to allow you to bias how the curve changes between the two values which is what mental ray’s brdf thingy does I believe.

So much to learn still, thanks for sharing your information. I kind of hate myself a little for building wrong shaders for so long but thanks!

Sorry, I should note, I was aware that most metals “diffuse” look comes from larger than expected glossiness values however I wasn’t aware it had zero at all and often the diffuse component to my shaders is wayyyyy too high now that I think about it