MistyLaraCarrara opened this issue on Mar 12, 2014 ยท 100 posts
bagginsbill posted Wed, 19 March 2014 at 9:26 PM
While I'm waiting for the render, I'll describe how I derived this shader.
The transparency parameter, when using a plugged-in node, is actually not transparency. It becomes opacity. It means that (for the most part) the node value in transparency determines what fraction of the shader input is actually emitted. The complement of that amount is transmitted from the other side of the object.
So, assuming that, as usual, we want a Fresnel effect for reflection (which will be among the things produced by the shader) we can get a simpler shader if we start with the assumption that the opacity (what we plug into the transparency channel) is going to be given by a Fresnel_Blend node set with the desired IOR for the material reflection effect.
Letting F denote the Fresnel reflection coefficient, R denote reflection, T denote transmission (from transparency) and C to denote the desired refraction (had to pick some letter), we're trying to make a shader that emits the standard fresnel glass:
FR + (1-F)C
When we use transparency for F and plug in reflection plus some unknown thing, X, we'll get:
F(R + X) + (1-F)T
The quest for the correct shader would have us somehow convert the latter into the former. What we seek, then, is:
F(R + X) + (1-F)T = FR + (1-F)C
Now we solve for X.
{ divide by F }
R + X + (1-F)T/F = R + (1-F)C/F
{ subtract R}
X + (1-F)T/F = (1-F)C/F
{ isolate X }
X = (1-F)C/F - (1-F)T/F
{ or another way to say it by factoring }
X = (1-F) (C - T) / F
{ or another way to say it by addition }
X = (1-F)/F * C + (-(1-F))/F * T
Recognizing now that T can be generated using a Refract with IOR=1, and C is the desired Refract that we actually want, we can see several ways to construct this. We can compute C-T (subtract the two refract nodes) and then scale this by (1-F)/F, then plug this into the root node.
Or - we can use the Poser Surface root node to do the addition. This is what I chose to do since it saves a node or two.
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)