Exampe OSL structure.
struct PbrBundle {
color SurfaceColor;
float Subsurface;
float Metallic;
float Specular;
float Roughness;
color EmissiveColor;
float EmissiveIntensity;
};
There is a shader, which takes all PbrBundle records and unifies them into a PbrBundle.
shader packPbr
[[
string as_node_name = "Pack PBR parameters.",
string as_category = "util"
]]
(
color SurfaceColor = 0.8
[[ string label = "amplitude 0"]],
float Subsurface = 0.0,
float Metallic = 0.0,
float Specular = 0.5,
float Roughness = 0.5,
color EmissiveColor = 0.0,
float EmissiveIntensity = 0.0,
output PbrBundle PbrB = {0}
)
{
PbrB.SurfaceColor = SurfaceColor;
PbrB.Subsurface = Subsurface;
PbrB.Metallic = Metallic;
PbrB.Specular = Specular;
PbrB.Roughness = Roughness;
PbrB.EmissiveColor = EmissiveColor;
PbrB.EmissiveIntensity = EmissiveIntensity;
}
There is another shader, which composites PbrBundle’s to create new PbrBundle’s. With it I like to create composite materials for texturing in Blender.
However. What Cycles does . It splits the PbrBundle struct (PbrB) into its components.
Do you know a way how to enable OSL structs in Cycles nodes in Blender 2.80?