Forum: Poser - OFFICIAL


Subject: Nodes for Dummies

RobynsVeil opened this issue on Jan 24, 2009 · 490 posts


RobynsVeil posted Mon, 09 March 2009 at 8:15 AM

Oh, what a complex web we weave, when first we practice to...
...write scripts.

Not even going to mess with AO right now. Read a bit on the VSS Opinions thread about what all's got to be considered, and I'm just not going there. At the risk of seeming analog, I thought I'd pursue my first objective with Pr2:
marrying much superior skin-tone technique with whatever make-up schemes I wanted.

I wasn't liking how the shader tended to attenuate the colours of my jpg make-up schemes. So, I created a mask, one to block out the effect of the shader (some, to a certain degree, not completely) over those areas I want the make-up to shine through.

Thus:
**...
  # Placeholder for colourMap
  colourMap = ImageMap("HeaMULolita.jpg").labelled("Color Map")
...
  # Gamma-Corr apply
  linearColormap = setSkin ** gamma

  # Set up specular node
  setSpec = Blinn(1,.4,.65,.4)
  
  # Set up the Diffuse node, keep it from exceeding conservation of energy with Specular
  setDiff = Diffuse(linearColormap, .7 * (1 - setSpec))
  setShader = (setDiff + setSpec) ** (1/gamma)
...
  s.Alternate_Diffuse = Blender(setShader, colourMap, ImageMap("HeaMkLipsEyes.jpg") * .9).labelled("MakeupMask")
...**

where ... is unchanged code from above.
What do they say about "a little knowledge is a dangerous thing"? I wonder if there's an inverse-proportion rule that applies here? If so, I'm deadly.

Two new challenges have arisen. One, now I've got a second version of the shader with code specific to this mask for the face and lips. Hey, no problem, right? I just create a new rule in VSS - kinda like what we were doing in Vr3 a while back, there - and pop that resultant mt5 in there. No dramas. Oh, and in the final version, I'll remove hard-coded references to any ImageMap files for that bit that goes in the template. That's just for testing. And that's what I did. And it worked. VSS is marvellous... so flexible!

However, you can see that I've kinda circumvented the gamma-correction within that last  Blender because I reference the colourMap node directly for the masking bit... and from a principles standpoint that just seems wrong. Oh, and it kinda looks wrong too. Seems the whole thing should be gamma corrected.

So, I did. Created a separate placeHolder for the gamma-corrected version of colourMap:

CGcolourMap = colourMap ** gamma
...

**  s.Alternate_Diffuse = Blender(setShader, GCcolourMap, ImageMap("HeaMkLipsEyes.jpg") * .9).labelled("MakeupMask")
...**

which then gets referenced in that last Blender. Looks better.

Probably still not right, but whoa, most of Heather's make-up looks much stronger, now. We've gone from:

to:

blending quite nicely with the shader. I'm not saying this is an improvement, but one can see the make-up scheme more clearly. And onecould dial in how much one wanted to see within that Blender node (currently set at .9).

Still a bit of work to do on those lips. Still, I feel I'm making headway. At this point, I could even explore which make-up colours go best with which skin tones, and do the skin tones when I set baseTone:

**  # Underlying skin tone
  baseTone = Blender(colourMap, Blender(ltBlue * colourMap, ltRed * colourMap, .5).labelled("BaseTone"), .7)
**

BTW, it's funny how, even after seeing how much easier and logical it is using code to create shaders, I still end up going back to the mat room and try to re-arrange the nodal spaghetti. Why?? What's the point?? Old habits die hard.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks