Help on using add or mix shader

Hi,i’m new here and i’m italian,so i apologize in advance for my english.
I’m making realistic metallic materials,using the complex refraction index (n,k) and calculating the conductors fresnel coefficient with a node group.
Since refraction index changes with wavelength (not only…) ,i don’t want to use a single ior.
I have calculated 3 different fresnel values for red,green,blue ( 0.685,0.532,0.462 nm),generating 3 distinct shaders,and now my problem arises.:spin:
Generally mix shader should respect energy conservation,add shader not always.
I don’t know if adding the 3 shaders (from 3 distinct channels red,green ,blues) ,respects energy conservation or it’s better to use mix shaders (with appropriate fac values,so that the 3 shaders have equal weight)
I enclose this image with blender cycles 2.77,the material is gold.
Right objects use add shaders,lefts objects use mix shaders. Thank you!

Attachments


Looks pretty obvious that the right one looks more gold than the other which is just way too dark. But why show shiny objects? They are hard to debug. Better is emission either as a pure output or where you separate the extremes (fresnel >, then facing color else edge color).

Mix or add? Depends. No hard rule stating one or the other. I can make glass mixing refraction and glossy the usual fresnel way, or I can add them together if the colors have been adjusted separately prior to adding - none of them are “wrong”, just different approaches giving the same result. Adding is also often used where you are actually supposed to add (like translucency), or when adding incandescence (obviously), or simply as a stylistic effect.

What’s the node setup? May be easier to spot problems there. Anyhow, I believe metallic shader is coming, supporting nk and artist friendly approaches. I prefer the latter, and for non strongly colored metals (most of them) using grey to bright grey over actual color is not what gives the material a realistic look.

The add shader is the right one here, since you don’t want the amount of reflectance in the red channel to depend on the amount of reflectance in the green and blue channel. Added together they will preserve energy. However, it’s much faster if you plug the output of your reflectance calculation into a color add node, and then plug that into a single glossy shader. See pic below for a (silly) example


And maybe you’d be interested in this thread: https://blenderartists.org/forum/showthread.php?403299-UPDATE-v1-5-Cycles-PBR-thin-film-interference-and-metals
I started it, and appreciate any feedback, for example on which wavelengths to choose to pick the n,k pairs from. My approach at the moment is this: https://blenderartists.org/forum/showthread.php?403299-UPDATE-v1-5-Cycles-PBR-thin-film-interference-and-metals&p=3082532&viewfull=1#post3082532

Hi. I have changed from MIX node to ADD node.
I enclose 2 renders with two gold colors,and 2 other pictures.
The first is the main material node with the different n,k values for red,green,blue, and the other is the content of material node (maybe a bit confusing).
Here we have :

  • the separation of the 3 channels (r,g,b)
  • the 3 values od fresnel conductor function (http://diazilla.com/doc/68580/11_modelli_avanzati, the formula)
  • the 3 mix of the diffuse (black) and glossy shader with fac = appropriate fresnel value
  • the add of the 3 results.
    I have maintained black diffuse shader ,because it represents the part of absorbed energy,which has not been reflected (or at least I think so)
    Then ,changing the glossy color to the standard gold color rgb (255,215,0),are reflections too yellow?
    (P.S. i,ve used wavelengths 685,.510,440 for red,gree,blue)
    Maybe i’m making mistakes in the method to determine the colors.
    Suggestions ae welcome!

Attachments




Hi. I have changed from MIX node to ADD node.
I enclose 2 renders with different gold glossy color,and 2 other pictures.
I have chosen wavelength 0.685,0.51,0.44 using a wavelength calculator on internet.
The first is the main material node with the different n,k values for red,green,blue, and the other is the content of material node.
Here we have :

  • the separation of the 3 channels (r,g,b)
  • the 3 values of fresnel conductor function, the formula for conductors
  • the 3 mix of the diffuse (black) and glossy shader with fac = appropriate fresnel value
  • the add of the 3 results.
    I have maintained black diffuse shader ,because it represents the part of absorbed energy,which has not been reflected.
    Using the second gold color (255,215,0),the usual gold color values ,found in internet,the render is much more yellowish.
    Which color is more realistic?
    Did i make mistakes in node setup or in the method?
    Suggestions are welcome :slight_smile:

Attachments




I can’t tell which is “more realistic”. If black diffuse results in an actual shader evaluation, this still results in 6 shader calls. Using minimum possible is something you should strive for, and you could get away with a single call (one glossy or anisotropic) in this case since normals and roughness is same over the channels (assumed, but would make sense). Ref prutser answer above. Showing actual reflections doesn’t really give me anything, mapped into emission would give something easier to evaluate, maybe even separate into three distinct areas; facing, edgetint, and white.

I have maintained black diffuse shader ,because it represents the part of absorbed energy,which has not been reflected

I understand your idea behind this, but it isn’t necessary. The fact that gold absorbs is included in the Fresnel value. The fact that it’s less than or at best equal to 1 means that the remainder of the light is absorbed. This in contrast to glasses, where the non-reflected part is transmitted.

Another hint: the Fresnel value of metals depends on the wavelength, which gives gold its color. Therefore, you can directly combine the Fresnel value for the R, G and B channels into a single color, which you then plug into the glossy shader. No other colors are required (unless you want that, of course) and no other shaders are necessary.

Hi.As you suggested,i have used fresnel values to create the glossy color.
But however,as far as i have understood,with fresnel,reflectivity is higher with high incident angles,although with metals the effect is less visible.
So i have not deleted the black diffuse node,mixing it with the “fresnel” glossy RGB colors ,with fac = fresnel RGB values.
The result is the first render.
The second render is the fresnel reflectivity (with emission node) for red,green and blue.
Gold is very reflective and we have more difference with blue wavelength and less difference with green wavelength.

Attachments