标签:
node_parameters {}
里面应当把所有的 参数都用AiParameterFLT/RGB等参数调用方法 放进去
如
// DIFFUSE AiParameterRGB ( "color", 1.0, 1.0, 1.0); AiParameterFLT ( "Kd", 0.8f); AiMetaDataSetFlt(mds, "Kd", "min", 0.0f); AiMetaDataSetFlt(mds, "Kd", "softmax", 1.0f); AiParameterFLT ( "diffuseRoughness", 0.0f); AiMetaDataSetFlt(mds, "diffuseRoughness", "min", 0.0f); AiMetaDataSetFlt(mds, "diffuseRoughness", "max", 1.0f); AiParameterFLT ( "Kb", 0.0f); AiMetaDataSetFlt(mds, "Kb", "min", 0.0f); AiMetaDataSetFlt(mds, "Kb", "max", 1.0f); AiParameterBOOL("FresnelAffectDiff", true); AiParameterFLT ( "directDiffuse", 0.0f); AiParameterFLT ( "indirectDiffuse", 0.0f);
如果缺少参数的话,实际shader参数调用会混乱
类似 metadata的设置,可以在 .mtd文件里面进行设置
AiMetaDataSetFlt(mds, "diffuseRoughness", "min", 0.0f); AiMetaDataSetFlt(mds, "diffuseRoughness", "max", 1.0f);
标签:
原文地址:http://my.oschina.net/zsjasper/blog/371782