| 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.
Image filters process the entire image, after all the pixels have been resolved. Please also consider the more versatile and convenient Image Filter LOP.
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, pixel 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. The pixel filter determines how samples are distributed over the pixel for the whole image.
On the other hand, Sample Blending is defined on each AOV individually. Thus, a color AOV might have Sample Blending that averages samples together, while an AOV for surface normals might take a single sample. Each AOV only has one Sample Blending method defined.
Sample and image filters are specified using a JSON string. Each filter is specified by a JSON list of two elements. The first element specifies the name of the filter, the second argument is a dictionary of arguments to control the filter’s behavior.
Image Filters ¶
ocio
Key |
Type |
Description |
|---|---|---|
|
string |
Required The list of AOVs to be processed by OCIO. |
|
string |
Required Output color space name. |
|
string |
Source color space name. The default is |
|
string |
A comma separated list of color grading names. |
Example: [ "ocio", {"planes":"C,diff*,spec*", "output":"sRGB"} ]
denoise
Key |
Type |
Description |
|---|---|---|
|
string |
The denoiser to apply (for example “oidn” or “optix”). |
|
list of strings |
List of AOV names to de-noise. Default is |
|
boolean |
Whether to pass the |
|
boolean |
Whether to pass the |
Example: [ "denoise", {"engine":"optix", "use_n_input":true, "use_albedo_input":true ]
Sample Filters ¶
colorlimit
Key |
Type |
Description |
|---|---|---|
|
string |
Comma separated list of AOV names/patterns to color limit. |
|
float |
The maximum channel value allowed. |
Example: [ "colorlimit", {"planes":"C*,color*,diff*", "colorlimit":10.0} ]
copyalpha
Key |
Type |
Description |
|---|---|---|
|
string |
Comma separated list of AOV names/patterns to use as input. |
This is added automatically by the renderer to copy the Af render global to the fourth component of any AOVs defined by LPE.
ocio
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).
Key |
Type |
Description |
|---|---|---|
|
string |
Required Comma separated list of AOV names/patterns to process with OCIO. |
|
string |
Required Output color space name. |
|
string |
Source color space name. The default is |
|
string |
Comma-separated list of color grading names. |
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 ¶
There are two parts to pixel filters: the statistical distribution of samples inside a pixel and how the individual samples are blended together.
The distribution of samples is controlled by the Pixel Filter parameter on the Render Settings primitive. The Box Filter will distribute the samples unformly over the pixel in a rectangular space. The radial filters (Gaussian, Blackman and Blackman-Harris) will distribute the samples according to the filter shape selected.
The Pixel Filter Scale can be used to make the sampling sharper or softer. Lowering the Pixel Filter Scale below 1 may introduce temporal sampling artifacts due to under-sampling in parts of the pixel.
The other part of pixel filtering is how the samples are combined to produce the final pixel color. This can be done independently for each AOV and is specified on each RenderVar.
Average Sample Values (ubox)
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 (minmax)
Take only the sample with the minimum or maximum value.
Closest (zmin), Farthest (zmax)
Choose the sample that shades the point that’s closest or farthest from the camera.
Stats: Mean Squared Error (stats)
Compute the Mean Squared Error (mse) of all the sample values.
Stats: Variance (stats)
Compute the variance of the samples in the pixel.
Stats: Even/Odd Samples (stats)
Average the values, but only use half the samples (either the even or odd samples).
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
Distribute rays based on variance in the rendered image.
Key |
Type |
Description |
|---|---|---|
|
integer |
The minimum number of samples. Set to '-1' to make it automatic based on maximum primary sample count. |
|
float |
The pixel variance. |
|
string |
Space separated list of image planes to measure. |
|
integer |
How to apply OCIO transform when measuring variance. Set to |
|
string |
OCIO display (ignored unless |
|
string |
OCIO view (ignored unless |
|
string |
OCIO color space (ignored unless |
Example: [ "variance", {"minrays":2, "plane":"C", "variance":0.01} ]