Radeon ProRender

Morphological Antialiasing Filter

Filter

RIF_IMAGE_FILTER_MLAA

Description

The filter performs Morphological Antialiasing (MLAA) for input image. MLAA is an image-based, post-process filtering technique which identifies discontinuity patterns and blends colors in the neighbourhood of these patterns to perform effective anti-aliasing.

Parameters

Parameter Type Input/Output Description
meshIDImg image input The image containing IDs of meshes. Used to find boundaries of objects. The parameter is optional. If used, can improve finding of boundaries.
normalsImg image input The image containing normal vectors in the [-1, 1] range. Used to find boundaries of objects. The parameter is optional. If used, can improve finding of boundaries. Use the normalTreshold parameter to adjust the sensitivity of the boundaries detector.
depthImg image input The image containing depth value. Used to find boundaries of objects. The parameter is optional. If used, can improve finding of boundaries. Use the depthTreshold parameter to adjust the sensitivity of the boundaries detector.
colorTreshold float input The color threshold of the detector of boundaries. The colors differing more than the threshold will be recognized as the boundary and subjected to smoothing. A greater value corresponds to a large color difference needed to trigger.
Default value is 0.05.
normalTreshold float input The normals threshold of the detector of boundaries. The scalar product of the normal vectors near the border is less than the threshold will be recognized as the boundary and subjected to smoothing. The smallest value corresponds to a large normal difference needed to trigger.
Default value is PI/8.
depthTreshold float input The depth threshold of the detector of boundaries. The depths differing more than the threshold value will be recognized as the boundary and subjected to smoothing. A greater value corresponds to a large depth difference needed to trigger.
Default value is 0.1.

Usage Example

rif_image_filter filter = nullptr;
rifContextCreateImageFilter(context, RIF_IMAGE_FILTER_MLAA, &filter);
rifImageFilterSetParameterImage(filter, "meshIDImg", meshIDImage);
rifImageFilterSetParameterImage(filter, "normalsImg", normalsImage);
rifImageFilterSetParameterImage(filter, "depthImg", depthImage);
rifCommandQueueAttachImageFilter(queue, filter, inputImage, outputImage);
rifContextExecuteCommandQueue(context, queue, nullptr, nullptr, nullptr);