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

Now of course not every surface is black glass. We need a diffuse component.

When light strikes the surface, it has some chance or probability of being reflected. The fresnel value is giving us a number representing that probability. Of the remaining light that isn't reflected, the rest goes into the surface and is diffusely reflected in all directions. This sort of effect is computed by the Diffuse node as well as a few others. We'll start with Diffuse.

We'll want to make a color parameter so we can change the color easily in the shader, without going back to the matmatic script. You make color parameters using the PMC function. Let's pick a nice dark red to start - you can then change it in the material room.

color = PMC(Color(.3, 0, 0), "Color")

This data will be chosen by users (or you) on the basis of looking at it in the color chip. Well - that's how it looks. That isn't what the luminance data really should be. Remember, this is something your monitor is showing you, and it isn't linear.

In Poser Pro, all color chips are automatically anti-gamma corrected. But to make this work in all versions of Poser, we want to use the AGC function on it. So:

diffuseColor = AGC(color)

We will also want a parameter to control the diffuse reflection amount - usually called Diffuse Value.

diffuseValue = PM(.8, "Diffuse Value")

Then we want to make a Diffuse node out of those things:

diffuse = Diffuse(diffuseColor, diffuseValue)

Let's just see how that looks.

Putting this together in a new script, by itself, we use:

color = PMC(Color(.3, 0, 0), "Color")
diffuseColor = AGC(color)
diffuseValue = PM(.8, "Diffuse Value")
diffuse = Diffuse(diffuseColor, diffuseValue)
View(GC(diffuse))

It looks like the attached image.


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)