digitani opened this issue on Oct 13, 2013 · 47 posts
bagginsbill posted Sun, 10 November 2013 at 9:13 PM
Quote - Also, part of my original question, as I recall, was how to create a shader for Poser. How did you do that?
That would take quite a while. Are you interested enough to follow an explanation? Also, I simply don't have the patience to assemble complicated shaders by hand so I don't. I use my matmatic tool to generate the shader from a Python script. Here is that shader in its entirety expressed in matmatic.
def Gain2(x, c, r, g = .8):
return Gain((x - c) * (2.0 / r) + .5, g)
clr = AGC(PMC(WHITE, "Color"))
specColor = AGC(PM2(PMC(1, "Specular Color")))
specValue = PM2(.3, "Specular Value")
specRoughness = PM2(.3, "Specular Roughness")
spec = Specular(specColor, specValue, specRoughness)
clrMap = AGC(PM2(ImageMap().labelled("Color Map")))
clr = clr * clrMap
toonShadowMultiple = PM(.5, "Shadow Multiple")
toony = PM(.7, "Toony")
toonMid = PM(.6, "Toon Midpoint")
toonSpread = PM(.2, "Toon Spread")
lineColor = AGC(PMC(BLACK, "Line Color"))
lineThreshold = PM(.65, "Line Threshold")
lineSpread = PM(.2, "Line Spread")
dv = .8 * Sub(1, spec)
d = Diffuse(1, .8).asNumber()
v = Gain2(d, toonMid, toonSpread)
toon = Blend(toonShadowMultiple * clr, clr, v)
diffuse = Diffuse(clr, dv)
output = Blend(diffuse, toon, toony) + spec
line = Gain2(EdgeBlend(0, 1, 1), lineThreshold, lineSpread)
output = Blend(output, lineColor, line)
View(GC(output))
Note that the absurd formatting is the work of the forum, not me.
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)