######################################
## ##
## Pixel_Parser v01 Documentation ##
## ##
######################################
This Pixel_Parser node for the rendertree was created by Nicolas Petit with the help of
Alan Rogers (cheers for all the debugging and getting the math exp lib to work without the multi-threaded issues!!)
and Alloys Baillet.
#####################################
The a, b, c, d, e, f and g are colour inputs, the sa,sb,sc,sd etc are scalar inputs, so you can have animated inputs over time, so the expression isn't static...
the string input accepts these operators:
+ - * / (pretty self explanatory)
^ (this is pow, or x^y is x raised at the power of y)
% (mudolo, x%y finds the remainder of x/y)
cos sin tan (pretty self explanatory)
acos asin atan (arc functionS)
cosh sinh tanh (hyperbolic functions)
max min abs (pretty self explanatory)
avg (average of 2, 3 or any number of values... avg(a,b,c,2,0.5,a,a,sa) )
sum (sum of any number of values)
rand (random of 0 to 1 or any two values)
sqrt (squre root)
log (natural logarithm)
log10 (base 10 logarithm)
ceil (ceiling)
floor (floor)
fact (returns the factorial of x)
The following return boolean values:
> < <= >= (pretty self explanatory)
== (equals logical operator)
!= (not equals logical operator)
& (and logical operator)
| (or logical operator)
! (not logical operator)
the variable names for the colours and scalars are:
a or A
b, B
c, C
d, D
e, E
f, F
g, G
sa, SA
sb, SB
sc, SC
sd, SD
se, SE
sf, SF
sg, SG
So, a few examples:
A + B
a - B / sa * C ^ SC *2
cos( a * c ) / B
avg( a,b,c,a)
rand(0,0.5)
a>0.1 (returns a boolean, great for clamping values)
a != b (this returns a boolean value, either true or false, 0 or 1)
For simple compositing, here are a few examples (now included in the drop down):
a+b-a*b Screen
a * b Multiply
a + b Add
a - b Sub
a / b Divide
a + b - 2 * a *b Xor
min(a,b) Min
max(a,b) Max
abs(a-b) Difference
a*(1-(sb*sa/100)) + (b*sa/100) Over (where sb is the alpha of b and sa is the percentage slider)
etc...
So you can see that you can pretty much type in any kind of maths and have a lot more control over it than by simply using the mixer nodes...
It's also awesome for weird effects, or even getting more out of your fractals etc... for example, plug a fractal into a and set the coordinates so it isn't too noisy, so you get decent sized splotches of black and white.
now, type in the expr input:
a < sa / 100
Now slide SA back and forth. The fractal has just been clamped to black and white so you can get "eating out" effects without having to go through a colour correction node...
Now, type:
sin(a * SA)
and slide the SA slider up and down... you get more bang for your buck out of the fractal node...
etc... it's very open and controllable, so for you control freaks out there I hope you enjoy...
Hope you find this shader useful!
Nick Petit.
npetit@optusnet.com.au