Forum: Poser - OFFICIAL


Subject: Making a spec-cleaned texture in PP2012

RobynsVeil opened this issue on Jan 02, 2012 ยท 71 posts


bagginsbill posted Wed, 04 January 2012 at 7:36 AM

I already explained this elsewhere.

The actual numbers depend on the actual hue of the actual texture I'm using (or you're using.) If you change textures, to one with a different common hue or saturation, then those numbers change.

It is nothing more than eyeballing the average ratio of red to blue, so that the highlights, which you can plainly see with your eyes, show up in the detector.

The nominal ratio would involve a single value, but then you would also need to amplify the delta - I happened to roll the two into one since back then I was a less precise thinker than I am now.

So:

4B - 1.39R

is the same as:

1.39 * (2.878B - R)

What that is saying is: the highest ratio of red to blue that I considered to be a real diffuse value, with no highlight present, was 2.878. Then, I needed about 1.39 amplfication to get the cancellation that I wanted from the detector.

It works because the average hue/saturation has a characteristic ratio of red to blue, and that where there is a highlight, this ratio is disturbed. It happens because specular highlights adds a roughly equal amount to all three components.

Thus, if you were starting with a nominal ratio of

r = kb

where k is some arbitrary constant, and you are on an area where there is a highlight, then it will be such that the highlight disturbed the color as follows:

R = kb + s

B = b + s

The effective red R or blue B coming out of the texture is increased.

The detector is doing

kB - R

which is:

kb + ks - kb - s

leaving:

(k-1)s

Thus it is some measure of the specularity by simply subtracting these two things.

This number has some amplitude that is going to depend on many factors - you will want to scale it with some final amplification to make it into a working detector from 0 to 1.

At the time, I knew nothing about gamma, and if you go back and read the original, I mentioned the difficulty that darker parts seemed to exhibit a greater highlight delta, s, than lighter parts.

Today I understand that to be the effect of gamma. Given two base luminance values, and the addition of a fixed amount to both, the measured numerical difference will be higher on whichever started out lower. This is a simple consequence of the non-linearity of luminance in photographs.

The correct approach is to anti-gamma the texture first, then apply the detector, then apply the highlight remover, then gamma correct the result.


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)