Fix for OSL input parameter name mapping. When assigning input constants to shader parameters, use the compatible_name function to strip whitespace.

This commit is contained in:
Lukas Toenne 2012-09-04 16:47:00 +00:00
parent f51eb99faa
commit 64a4a05d31
2 changed files with 7 additions and 7 deletions

@ -50,12 +50,12 @@ shader node_wave_texture(
float Scale = 5.0,
float Distortion = 0.0,
float Detail = 2.0,
float dscale = 1.0,
float DetailScale = 1.0,
point Vector = P,
output float Fac = 0.0,
output color Color = color (0.0, 0.0, 0.0))
{
Fac = wave(Vector, Scale, Type, Detail, Distortion, dscale);
Fac = wave(Vector, Scale, Type, Detail, Distortion, DetailScale);
Color = color(Fac, Fac, Fac);
}

@ -200,19 +200,19 @@ void OSLCompiler::add(ShaderNode *node, const char *name)
switch(input->type) {
case SHADER_SOCKET_COLOR:
parameter_color(input->name, input->value);
parameter_color(compatible_name(input->name).c_str(), input->value);
break;
case SHADER_SOCKET_POINT:
parameter_point(input->name, input->value);
parameter_point(compatible_name(input->name).c_str(), input->value);
break;
case SHADER_SOCKET_VECTOR:
parameter_vector(input->name, input->value);
parameter_vector(compatible_name(input->name).c_str(), input->value);
break;
case SHADER_SOCKET_NORMAL:
parameter_normal(input->name, input->value);
parameter_normal(compatible_name(input->name).c_str(), input->value);
break;
case SHADER_SOCKET_FLOAT:
parameter(input->name, input->value.x);
parameter(compatible_name(input->name).c_str(), input->value.x);
break;
case SHADER_SOCKET_CLOSURE:
break;