About
Render filters are used to post-process rendered images. They are currently used to implement the denoiser filter.
The filter interfaces are defined in the render_filter.framework.
FilterContex
A FilterContexRef is the central class to create and use images, filters and queues.
Context implementations are found at the maxon::FilterContextClasses registry:
- maxon::FilterContextClasses::OIDNCONTEXT: Open Image Denoiser context implementation.
Queue
A command queue allows queuing of multiple filters.
Queue implementations are found at the maxon::FilterCommandQueueClasses registry:
- maxon::FilterCommandQueueClasses::OIDNFILTERCOMMANDQUEUE: Open Image Denoiser queue implementation.
Filter
The maxon::FilterInterface allows to use a render filter.
Filter implementations are found at the maxon::FilterClasses registry:
- maxon::FilterClasses::OIDNFILTERRT: Intel Denoiser Raytracing implementation.
FilterImage
A filter image contains the actual image data.
Image implementations are found at the maxon::FilterImageClasses registry:
- maxon::FilterImageClasses::OIDNFILTERIMAGE: Open Image Denoiser image implementation.
An image is created with maxon::FilterContextInterface::CreateImage() using these parameters:
- maxon::FilterImageDescriptionParameters::WIDTH: Image width.
- maxon::FilterImageDescriptionParameters::HEIGHT: Image height.
Open Image Denoiser parameters
The Open Image Denoiser filter can further be configured with these parameters:
- maxon::OIDNFilterParameter::HDR: If the input data is in hight dynamic range.
- maxon::OIDNFilterParameter::SRGB: True if the color data is in sRGB.
- maxon::OIDNFilterParameter::ALBEDO: Albedo buffer.
- maxon::OIDNFilterParameter::NORMAL: Normal buffer.
Example
{
for (
Int32 y = 0; y < height; ++y)
{
for (
Int32 x = 0; x < width; ++x)
{
bufferColor[pos] = color;
++pos;
}
}
}
maxon::FilterContextRef filterContext = maxon::FilterContextClasses::OIDNCONTEXT().Create()
iferr_return;
maxon::FilterCommandQueueRef commandQueue = filterContext.CreateCommandQueue()
iferr_return;
maxon::FilterRef filter = filterContext.CreateFilter(maxon::FilterClasses::OIDNFILTERRT.GetId())
iferr_return;
maxon::DataDictionary imgDesc;
imgDesc.Set(maxon::FilterImageDescriptionParameters::WIDTH,
static_cast<UInt32>(width))
iferr_return;
imgDesc.Set(maxon::FilterImageDescriptionParameters::HEIGHT,
static_cast<UInt32>(height))
iferr_return;
maxon::FilterImageRef beauty = filterContext.CreateImage(imgDesc)
iferr_return;
maxon::FilterImageRef output = filterContext.CreateImage(imgDesc)
iferr_return;
commandQueue.AttachFilter(filter, beauty, output)
iferr_return;
filterContext.ExecuteCommandQueue(commandQueue)
iferr_return;
Further Reading