Anti-reflective coating for glass in Cycles

Hi, I’m trying to do a lens, and because I like challenging stuff, i’m trying to actually do the optical components of the lens.
Long story short, normal glass shader is too reflective, and reflection color can’t be controlled.
What can I do?
How can i control the reflective amount and the colouring of it?
I tried using a glass shader and mixing them with a transparent or a glossy shader with a light path, but with no success.

Thanks in advance, will post link to completed stuff, when its complete of course.

Try to play with mix node and fresnel noce connected to Mix Fac, maybe controlled with some math node in between

I think you can still use light paths but not by mixing two shaders. What you can try:

  • you need one glass shader, the input color is controlled by a color -> mix node
  • as the factor value for the color-mix node you use the reflection light path
    -> the first color of the color-mix node affects the transmission of light through the lens (set it to white)
    -> the second color affects the light with is reflected by the glass (set it to the color you want)

So all in all you have four nodes: light-path connected with color-mix which is the input of the color-channel of the glass material (which is of course connected to the output node)
I haven’t tried it out but I think it should work.

Hi @BlackClaw, I have some tips for you about glass, I hope they will be useful:

  • Reduce the IOR value to reduce de reflectiveness, for example to ‘1.05’. I think this is not a good soluction if you are making a len and you want to preserve de len IOR properties.
  • Use point lamps instead of meshlights to make specular reflections disappear.
  • Finally, the only way I could reduce reflections to make a real glass material is using multiple lights with low strength. For example:
    • background, color (0.65,0.65,0.65) and strength 0.5
    • two big square meshlights, color similar to (0.8,0.8,0.8) and strength 1
    • one main meshlight , color similar to (0.8,0.8,0.8) and strength 15
      All meshlights far from the glass object.
      Keep the scene dark and improve it by compositing. The reflections will be more real.


Forget what I wrote before, the material I suggested is only colored when you see it as a glossy reflection.

But I had success with composite nodes:
In the Render-Layers tab you have to activate the buttons for Diffuse(Direct, Indirect, Color), Glossy(same) and Transmission. Then in the node editor (composite-nodes) you combine these layers as shown in the manual ( and multiply the glossy color with the color you like.
All Reflections should be colored while the light transmitted through the lens remains unchanged.

If you want to restrict the effect only on one material, use the material index(material tab -> settings -> Pass Index) and activate the “Material Index” in the Render Layers.

Here is the node setup and on the right side the material and render-layer settings:

I hope this helps you with coloring glossy reflections.

there was this example given a few weeks ago for a lens
sorry dont’ remember the thread for this
but here is the file

microscopelens.blend (78.1 KB)

it uses several lens to give the desired effect
but not certain you can control the IOR of the lens

hope it helps

Thanks, really. I forgot entirely about the light passes.
This could perfectly do it, however, it only lets me change the color of the first reflection of the first elementent, so I’m trying to do the real-life-like anti-reflection coating to see if I get the exact result I want.

(yeah, I’m trying to get perfect realism :cool:)

I think I got an excellent idea, although not exactly what I look for, because i kinda need the reflections.

The basic functioning of a simple anti-reflective coating is to introduce a new medium, with an IOR in between glass and air.
If a use the ray lenght input to control the IOR so its 1 when it touches the air, and 1.5 in, I dont know, 0.01 blender units, in theory can I should get a 0% reflectance and a 100% of transmittance, right?

Aaaand I could make a lens with a f-stop greater than 0.5, by gently bending the rays of the light.
(However, I dont know what can I do with that in blender…)

Then I should learn how to use the ray lenght input

It’s impossible to do what I want to do, as far asI know.
Why isn’t even there a “Substract shader” node if there is an “Add node”?