On this page |
In the Karma rendering pipeline, there are three separate types of filters.
-
Sample filters
-
Pixel filters
-
Image filters
Each filter works on AOV data at different stages of the rendering pipeline. Sample filters access raw sample data straight from ray evaluation. These filters run independent of any other samples.
Pixel filters combine multiple samples into a single pixel value. These filters.
Image filters process the entire image, after all the pixels have been resolved.
You can get a list of all filters using the command line tool by running:
karma --filters
At the current time, this doesn’t list any options to control filters.
Sample and Image filters are "global" and run on all AOVs simultaneously. For example, a sample filter might take multiple AOVs for different color components and sum them into a different AOV. An image filter might take several AOVs and use them to run a denoiser on other AOVs. There can be multiple Sample and Image filters for each render.
On the other hand, Pixel Filters are defined on each AOV individually. Thus, a color AOV might have a Pixel Filter that averages samples together, while an AOV for surface normals might take a single sample. Each AOV only has a single Pixel Filter defined.
Sample and Image filters are specified using a JSON string. Each filter is specified by a JSON list of 2 elements. The first element specifies the name of the filter, the second argument is a dictionary of arguments to control the filter’s behaviour.
Image Filters
ocio [arguments]
-
string planes <aov_pattern> The list of AOVs to be processed by OCIO (required)
-
string output <output_space> Output color space (required)
-
string input <input_space> Source color space (default "scene_linear")
-
string looks <looks> A comma separated list of color gradings
Example: [ "ocio", {"planes":"C,diff*,spec*", "output":"sRGB"} ]
denoise [arguments]
-
string engine The denoiser to apply (for example "oidn" or "optix")
-
bool albedo Pass "albedo" plane to denoiser
-
bool use_N_input Pass "N", "Ng" or "normal" plane to denoiser
-
bool use_gl_output Output directly to OpenGL
Example: [ "denoise", {"engine":"optix", "use_n_input":true, "use_albedo_input":true ]
Sample Filters
colorlimit [arguments]
-
string planes <aov_pattern> The list of AOVs to be color limited
-
float colorlimit <value> The maximum channel value allowed
Example: [ "colorlimit", {"planes":"C*,color*,diff*", "colorlimit":10.0} ]
copyalpha [arguments]
-
string planes <aov_pattern> The list of planes as input
This is added automatically by the renderer to copy the Af render global to the 4th component of any AOVs defined by LPE.
ocio [arguments]
-
string planes <aov_pattern> The list of AOVs to be processed by OCIO (required)
-
string output <output_space> Output color space (required)
-
string input <input_space> Source color space (default "data")
-
string looks <looks> A comma separated list of color gradings
This sample filter is primarily an example since it’s much more efficient to do color correction in the image filter (after samples have been combined by pixel filters).
Example: [ "ocio", {"planes":"C,diff*,spec*", "output":"sRGB"} ]
Tip
You can chain multiple image filters (or sample filters):
[ [ "denoise", {"engine":"oidn", "aovs":["Cf","diffuse","specular"]} ], [ "ocio", { "planes":"C,diff*", "output", "sRGB" }] ]
Pixel Filters
Radial Pixel Filter
Names: bartlett, blackman, box, catrom, gauss, hanning, mitchell, sinc
These pixel filters are radial filters which combine samples using the given filter shapes.
Options:
-
float width <filter_width> The filter width
Example: [ "gauss", {"width":2.5} ]
Unit Box Filter
Uniform box filter. This simply averages all the samples which fall within a pixel. This is different than the box filter which blends in samples from adjacent pixels (based on the filter width).
Min/Max Filters
Name: min, max Take only the sample with the minimum or maximum value Name: omin, omax Currently, these are synonyms for the min, max filters Name: ocover, edge, idcover Currently, these are not implemented
Pixel Oracles
Pixel Oracles are related to filters in karma. Oracles are used to tell the renderer where additional samples need to be sent. Unlike filters, Oracles take a simple string which is parsed into arguments.
Currently, there are two oracles:
uniform
-
Uniformly distribute rays to each pixel. Each pixel will always get the same number of ray-samples.
variance
-a <adjacent_count> Look at the variance of adjacent pixels (8) -m <min_samples> The minimum number of samples -v <variance> Specify the pixel variance -c <color_aov> The image plane to measure