Samplers
Compatibility:
- Info: lwks.com starting on page 12.
- Info: lwks.com starting on page 20.
- Linux and Mac: Only one sampler should be created per texture.
- Address Border: Unfortunately, no details are documented yet.
Quote from jwrl:.. it behaves differently in Windows and Linux.
Sampler settings
- Examples:
- Create a sampler called “BorderSample” that uses the texture of input “In1”
sampler BorderSampler = sampler_state { Texture = <In1>; AddressU = Border; AddressV = Border; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; };
- Another example with several samplers
- Create a sampler called “BorderSample” that uses the texture of input “In1”
- In case the scaling is changed or the texture position is shifted
(sampler position is different than the original texture coordinates):
Please always set AddressU, AddressV, and Filter for each sampler. Otherwise, undefined states can lead to unexpected results. - If your effect moves the original position of the pixels (eg zooming), then it can happen:
- That the calculation results in pixel positions outside the source textures
(outside the normal range from 0 to 1).
(Behavior can be set with “AddressU” and “AddressV”) - That pixel positions have been calculated that are not at the center of a pixel (Wndows). (Behavior adjustable with filter settings)
- There are several ways the sampler should proceed in these cases (Windows).
- That the calculation results in pixel positions outside the source textures
- Examples of different Address settings
The following examples were zoomed out. Note that zooming is not done with the sampler settings, but is programmed in the program part “Shaders”. - Filer
MinFilter = Linear
(Zoom out)
MagFilter = Linear
(Zoom in)
This causes the sampler to mix adjacent pixels when looking for a position between the centers of those pixels.MinFilter = Point
(Zoom out)
MagFilter = Point
(Zoom in)
This setting prevents pixel interpolation.- MipFilter (It is unclear whether this filter has any function in Lightworks effects)?