color shader (color Color, color incandescence, color transparency, float diffval)
{
color diff = Color * diffuse() * diffval;
float transp = grayscale(transparency);
return (diff * (1.0 - transp)) + transparent() + incandescence;
}
std::string serialized;
oslRenderer->shadingsys->getattribute(shaderGroup.get(), "pickle", serialized);
2015-07-25T13:37:26.666081Z <001> 543 MB error | error parsing osl param value, param = offsetU, value = 0; will use the default value.
2015-07-25T13:37:26.666081Z <001> 543 MB error | error parsing osl param value, param = offsetV, value = 0; will use the default value.
2015-07-25T13:37:26.667081Z <001> 543 MB error | error parsing osl param value, param = repeatU, value = 1; will use the default value.
2015-07-25T13:37:26.667081Z <001> 543 MB error | error parsing osl param value, param = repeatV, value = 1; will use the default value.
2015-07-25T13:37:26.667081Z <001> 543 MB error | error parsing osl param value, param = rotateUV, value = 0; will use the default value.
2015-07-25T13:37:26.668081Z <001> 543 MB error | error parsing osl param value, param = uvCoord, value = 00000000571CDB58; will use the default value.
2015-07-25T13:37:26.668081Z <001> 543 MB debug | created shader place2dTexture, layer = place2dTexture1.
float vec[3];
float m[4][4];
float fv = 0.0f;
int intv = 0;
std::string sv;
if (param.type == OSL::TypeDesc::TypeFloat)
{
fv = boost::get<float>(param.value);
Logging::debug(MString("MAYATO_OSL::createOSLShader creating param ") + pname + " : " + fv);
asParamArray.insert(pname.asChar(), fv);
}
if (param.type == OSL::TypeDesc::TypeInt)
{
intv = boost::get<int>(param.value);
asParamArray.insert(pname.asChar(), intv);
}
if (param.type == OSL::TypeDesc::TypeVector)
{
MAYATO_OSL::SimpleVector &v = boost::get<MAYATO_OSL::SimpleVector>(param.value);
vec[0] = v.f[0];
vec[1] = v.f[1];
vec[2] = v.f[2];
asParamArray.insert(pname.asChar(), vec);
}
if (param.type == OSL::TypeDesc::TypeString)
{
sv = boost::get<std::string>(param.value);
asParamArray.insert(pname.asChar(), sv);
}
Hi Haggi,About your first question, it's not possible now. Could you create a new issue for it?
// Create OSL shader group.
bool create_optimized_osl_shader_group(
OSL::ShadingSystem& shading_system,
foundation::IAbortSwitch* abort_switch = 0);
// Release internal OSL shader group.
void release_optimized_osl_shader_group();
Regarding the error specifying shaders, I think you are missing the param type.param_array.insert("param_name_1", "float 0.7");param_array.insert("param_name_2", "int 4");param_array.insert("string_param_name", "string something");for multi-value params (colors, vectors, ...) use spaces as the separator between values:param_array.insert("color_param_name", "color 0.2 0.5 0.7);you can see the supported param types here:if you need a type that's not supported, open an issue and I'll add it.
--
You received this message because you are subscribed to the Google Groups "appleseed-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appleseed-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.