Forum: Poser - OFFICIAL


Subject: Nodes for Dummies

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


kobaltkween posted Mon, 01 June 2009 at 12:40 AM

ok, i think  i have a quick question.

i have your sRGB material for the artistic lens as an example of an end product.
i have your incorrect (according to you, i wouldn't have spotted the problem) sRGB Matmatic functions

Quote - def IF(test, tv, fv):
    return Blend(fv, tv, test)

def SRGB(x):
    return IF(x <= .0031308, 12.92 * x, 1.055 * (x ** (1/2.4)) - .055) def ASRGB(x):
    return IF(x <= .04045, x / 12.92, ((x + .055) / 1.055) ** 2.4)

so now i'm just playing with how to make a switch and apply different functions.  i know the node chain i want to make, but i can't seem to get there.  just to play and try and understand switches, i've tried

Quote -
def combineCorrect(test, f1, f2):
    return Add(test * f1, (1 - test) * f2)

def testSwitch(x):
    return combineCorrect(x <= 0.5, -0.25 * x, x * 1.75);

so the aspect of what i'm not getting when i look at the material i make is actual numbers for 0.25 and 1.75.  they make colors in a color math node instead of numbers leading to a color math node.  so i'm wondering how i should express it to get a color math node multiplying the input of x by an input of a math node with a numeric value rather than by a color swatch.