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:01 PM

If you're not using Poser Pro, we need to deal with gamma compensation.

The attached render shows what you get with ior=1.5 but no GC. It doesn't look right. The reflections are too dark.

As I've said many times, there are many ways to compensate for monitor gamma. Notice I didn't say correct for monitor gamma, but compensate. I don't want to have an argument about which technique you want to use to compensate. I'm just going to talk about gamma correction as one way to compensate, and demonstrate how easy it is with matmatic.

In matmatic, we have two functions to deal with gamma. They are

AGC - anti-gamma correct - used on color information coming into the shader.
GC - gamma correct - used on the final output of the shader.

In this shader, the Reflect node is bringing in color information from other parts of the scene. This is non-linear luminance info, since the other shaders are producing what they should when you look at them.

But we then multiply them with a linear fresnel reflection coefficient. This effectively screws up the luminance information. If we take half of a reflection, it doesn't look half as bright. It looks a lot darker than that.

So - we need to convert the incoming data from the reflect node to linear luminance information. We do that by saying:

reflect = AGC(Reflect())

This anti-gamma corrects the incoming data so it is linear.

Upon performing the calculation of the final pixel color we want, then we need to correct it for display.

output = GC(combination)
surface = View(output)

The whole script is now this:

ior = PM(1.5, "IOR")
fresnel = TrueFresnel(ior)
reflect = AGC(Reflect())
combination = fresnel * reflect
output = GC(combination)
surface = View(output)

Using this script, you'll get the same results I'm getting even if you don't have Poser Pro.


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)