Custom Code Sample
This material graph sample demonstrates how to create and use nodes containing a custom shader code.
Albedo RGB data and Opacity value (fully opaque) for the Deferred PBR Material master material node are specified directly via port adapters.
The custom node has two float input ports (a and b) and two float output ports (return value Out and c output). They are automatically added according to the function signature.
a and b values for the custom function node are provided by Float Slider nodes of the UI group (adjustable via the Parameters panel in the UnigineEditor) connected to it.
The result of linear interpolation between a and b values is connected to the roughness input port of the Deferred PBR Material master material node, while the sum of a and b - to metalness.
Finally, the data output is passed to the Final Material node.