Asgar
08-08-2005, 12:02 PM
Hi!I'm new in renderman world!!!
I wrote a simple shader but i have some problem with the slim template!!
here's the code!!
Thanks for help!!!
Debug write:
ERROR: Primary Compiler:
ERROR: "MBlend_0.sl", line 93: ERROR: argument mismatch for function "mxslMBlend"
ERROR: Possible choices were:
ERROR: <unknown type> mxslMBlend(color; color; float; float; color)
ERROR: Your call was:
ERROR: float mxslMBlend(uniform float; uniform color; uniform color; uniform float; varying color)
ERROR:
ERROR: MBlend_0: ERRORS -- NOT COMPILED.
ERROR: Shader not compiled
slim 1 extensions Asgarmx {
extensions Asgar mxsl {
template color MBlend {
description "Combines or blend two color functions."
parameter float Mode {
label "Mode"
subtype selector
range {
"Sum" 0
"Subtract" 1
"Multiply" 2
"Union" 3
"Difference" 4
"Blend" 5
}
default 5
}
parameter color color_A {
detail varying
default {0 1 0}
}
parameter color color_B {
detail varying
default {1 0 1}
}
parameter float Blender {
default .5
value 1.00
range {0 1}
provider constant
subtype slider
detail varying {}
}
parameter color result {
access output
display hidden
}
RSLFunction {
void mxslMBlend(
color color_A;
color color_B;
float Blender;
float Mode;
output color result;
)
{
/* Sum */
if (Mode == 0)
result = color_A + color_B;
/* Subtract */
else if (Mode == 1)
result = color_A - color_B;
/* Multiply */
else if (Mode == 2)
result = color_A * color_B;
/* Union */
else if (Mode == 3)
result = color_A + color_B - color_A * color_B;
/* Difference */
else if (Mode == 4)
result = color_A - color_A * color_B;
/* Blend */
else if (Mode == 5)
result = mix(color_A,color_B,Blender);
}
}
}
}
}
I wrote a simple shader but i have some problem with the slim template!!
here's the code!!
Thanks for help!!!
Debug write:
ERROR: Primary Compiler:
ERROR: "MBlend_0.sl", line 93: ERROR: argument mismatch for function "mxslMBlend"
ERROR: Possible choices were:
ERROR: <unknown type> mxslMBlend(color; color; float; float; color)
ERROR: Your call was:
ERROR: float mxslMBlend(uniform float; uniform color; uniform color; uniform float; varying color)
ERROR:
ERROR: MBlend_0: ERRORS -- NOT COMPILED.
ERROR: Shader not compiled
slim 1 extensions Asgarmx {
extensions Asgar mxsl {
template color MBlend {
description "Combines or blend two color functions."
parameter float Mode {
label "Mode"
subtype selector
range {
"Sum" 0
"Subtract" 1
"Multiply" 2
"Union" 3
"Difference" 4
"Blend" 5
}
default 5
}
parameter color color_A {
detail varying
default {0 1 0}
}
parameter color color_B {
detail varying
default {1 0 1}
}
parameter float Blender {
default .5
value 1.00
range {0 1}
provider constant
subtype slider
detail varying {}
}
parameter color result {
access output
display hidden
}
RSLFunction {
void mxslMBlend(
color color_A;
color color_B;
float Blender;
float Mode;
output color result;
)
{
/* Sum */
if (Mode == 0)
result = color_A + color_B;
/* Subtract */
else if (Mode == 1)
result = color_A - color_B;
/* Multiply */
else if (Mode == 2)
result = color_A * color_B;
/* Union */
else if (Mode == 3)
result = color_A + color_B - color_A * color_B;
/* Difference */
else if (Mode == 4)
result = color_A - color_A * color_B;
/* Blend */
else if (Mode == 5)
result = mix(color_A,color_B,Blender);
}
}
}
}
}
