Forum: Poser - OFFICIAL


Subject: VSS Skin Test - Opinions

bagginsbill opened this issue on Apr 23, 2008 · 2832 posts


bagginsbill posted Fri, 07 October 2011 at 3:10 PM

My VSS skin shader script has many options and layers in it. I'm sloooowly assembling all these components into what will eventually be VSS Pro. I just opened it up - haven't looked in a while, and it is currently a 600 lines Python script. Much of it I do not immediately understand anymore.

Here's the part that does the fake SSS. I know how to add it and remove it easily, but what nodes does it generate in that shader? Nobody knows - not even me.

 

class SSS2(MaterialLayer):
        SSSColor = Color(1, .2, 0)
        def build(self, s):
                e = s.Energy
                e2 = getattr(s, 'EnergySub', None)
                if e2:
                        e = .5 * e + .5 * e2
                if e:
                        s.SSSE = e
                        diffuse = Clay(1, 1, 1)
                        sssAmount = PM(1, 'SSS')
                        clr = PMCgc(self.SSSColor, 'SSS Color')
                        sss = clr * sssAmount * SmoothStep(Sub(1, PM(1, 'SSS Falloff')
                               * diffuse)) * diffuse * s.DiffuseColor
                        s.addResult(e * sss)
        def post(self, s):
                        s.Result = Blend(s.Result, s.SSSE, PM(0, 'Show SSS e'))

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)