SSS Uber Material Creation

One of the matballs in the Uber Material tutorial demonstrates how to apply Subsurface Scattering with Uber Material. A notable part in the material definition is to use both RPR_MATERIAL_INPUT_UBER_SSS_* and RPR_MATERIAL_INPUT_UBER_BACKSCATTER_* inputs.

Example of source code producing the material shown in the illustration.

rpr_material_node material = nullptr;
rprMaterialSystemCreateNode(matballScene.m_matsys, RPR_MATERIAL_NODE_UBERV2, &material);

rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_DIFFUSE_COLOR,1.0f,1.0f,1.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_DIFFUSE_WEIGHT,0.4790f,0.4790f,0.4790f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_DIFFUSE_ROUGHNESS,0.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputNByKey(material,RPR_MATERIAL_INPUT_UBER_DIFFUSE_NORMAL,normalMat);

rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_COLOR,1.0f,1.0f,1.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_WEIGHT,1.0f,1.0f,1.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_ROUGHNESS,0.6500f,0.6500f,0.6500f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_ANISOTROPY,0.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_ANISOTROPY_ROTATION,0.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputUByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_MODE,0);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_IOR,1.50f,1.50f,1.50f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_METALNESS,0.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputNByKey(material,RPR_MATERIAL_INPUT_UBER_REFLECTION_NORMAL,normalMat);

rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_TRANSPARENCY,0.0f,0.0f,0.0f,0.0f);

// Enable and set SSS inputs
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_SSS_SCATTER_COLOR,1.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_SSS_SCATTER_DISTANCE,0.5f,0.5f,0.5f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_SSS_SCATTER_DIRECTION,0.0f,0.0f,0.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_SSS_WEIGHT,0.8720f,0.8720f,0.8720f,0.0f);
rprMaterialNodeSetInputUByKey(material,RPR_MATERIAL_INPUT_UBER_SSS_MULTISCATTER,1);

// Enable and set Backscatter inputs
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_BACKSCATTER_COLOR,1.0f,0.70f,0.0f,0.0f);
rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_UBER_BACKSCATTER_WEIGHT,0.7500f,0.7500f,0.7500f,0.0f);

rprMaterialNodeSetInputFByKey(material,RPR_MATERIAL_INPUT_SCHLICK_APPROXIMATION,1.0f,1.0f,1.0f,1.0f);

Full source code can be found in the Uber Material tutorial.