Forum: Poser - OFFICIAL


Subject: Nodes for Dummies

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


RobynsVeil posted Wed, 25 February 2009 at 8:54 AM

Just to demonstrate how incredibly slowly I'm going to proceed through this, I'm going to do slight variations on the theme. As in:

def makeSurface(x):
  s = Surface(0,0,0)
  s.Alternate_Diffuse = SimpleColor(x)
  return s

makeSurface(RED)

generated the same material. makeSurface() now has an argument... x. Tried:

def makeSurface(x):
  s = Surface(0,0,0)
  s.Alternate_Diffuse = SimpleColor(x)
  return s

makeSurface(GREEN)

generated the expected material with the expected changes. Time to branch out a bit.

def makeSurface(x, y):
  s = Surface(0,0,0)
  s.Alternate_Diffuse = SimpleColor(x) * y
  return s

makeSurface(GREEN, .5)

Compiled just fine... a titch worried, because "complied fine" doesn't imply "valid results". Having a look at the shader tree to see what the multiply operator does... well, SImpleColor(GREEN) seemed to stay green, but the RGB colour value in the alternate_diffuse channel on the PoserSurface node has gone from 255,255,255 to 127,127,127.

Interesting.

Might try other operators. Lets get simple and just use the addition + operator.

def makeSurface(x, y):
  s = Surface(0,0,0)
  s.Alternate_Diffuse = SimpleColor(x) + y
  return s

makeSurface(GREEN, .5)

Well!!!

Where the multiply operator appeared to affect the alternate_diffuse colour channel itself - halving the RGB value - the addition operator creates this material:

The .5 seems to somehow affect value_2 of the Math_Functions(add) node. Well, makes sense because we are adding that value to 1. So, the actual color is GREEN  (0,255,0) + 127,127,127? A super color?

Gonna have to sleep on it. I'm certainly not going to let what I see in preview affect what I think it is, because the math is telling me differently. I really think I AM looking at a super-color...

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