Forum: Poser - OFFICIAL


Subject: Glossy materials with true Fresnel effect using matmatic

bagginsbill opened this issue on Sep 29, 2010 ยท 74 posts


bagginsbill posted Wed, 29 September 2010 at 3:04 PM

The last thing to deal with is soft, blurry reflections.

Note: Unless you have a powerful computer, you may want to stay away from trying blurred reflections.

You can only go so far with this before you get artifacts in Poser. But still it can be used to good effect, particularly in architectural metals.

We want to add a parameter to deal with blur:

blur = PM(0, "Blur")

I set it to 0 initially, but when you want, you change it in the material room.

We want to use this to increase the eccentricity:

eccentricity = .02 + .2 * blur
specular = Blinn(specularColor, eccentricity, .4 + .5 * metallic, 2 * reflectivity)

Also, we need to make the Blinn node less reflective when it is blurry. I'll use an exponential function: .25 ** blur. When blur is 0, this is 1. When blur is 1, this is .25. In between it will interpolate quadratically.

specReflectivity = 2 * reflectivity * (.25 ** blur)
specular = Blinn(specularColor, eccentricity, .4 + .5 * metallic, specReflectivity)

And we'll need to increase the reflect node softness and quality to go with the blur.

quality = .2 + Clamp(5 * blur)
reflect = AGC(Reflect(BLACK, blur, quality)) * specularColor

Putting it all together, the script is:

color = PMC(Color(.3, 0, 0), "Color")
diffuseValue = PM(.8, "Diffuse Value")
ior = PM(1.5, "IOR")
reflectivity = PM(.5, "Reflectivity")
blur = PM(0, "Blur")
quality = .2 + Clamp(5 * blur)

diffuseColor = AGC(color)
metallic = Clamp(.05 * (ior - 3))
specularColor = Blend(WHITE, diffuseColor, metallic)

eccentricity = .02 + .2 * blur
specReflectivity = 2 * reflectivity * (.25 ** blur)
specular = Blinn(specularColor, eccentricity, .4 + .5 * metallic, specReflectivity)
specular = PM(specular)
diffuseValue = diffuseValue * Sub(1, Clamp(specular))
diffuseValue = diffuseValue * (1 - .98 * metallic)
diffuse = Diffuse(diffuseColor, diffuseValue)

fresnel = TrueFresnel(ior) * reflectivity
reflect = AGC(Reflect(BLACK, quality, blur)) * specularColor

combination = Blend(diffuse, reflect, fresnel) + specular
output = GC(combination)
surface = View(output)

With blur=1, see the attached render.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)