util-lanczos
This contains the function and coefficients to perform a 2x Lanczos downsample along a specific direction (either horizontal or vertical).
The code has been optimized to take advantage of linear texture filtering (using the same technique used to generate the gaussian filters at https://drilian.com/gaussian-kernel/, using 4 texture samples for an 8-tap filter.
Index
Constants
Functions
Constants
float k_coeffs[4]float k_offsets[4]Functions
- Lanczos2xDownsample
-
float4 Lanczos2xDownsample( DECLARE_TEXTURE2D_AND_SAMPLER_PARAM(sourceTexture, samp), float2 centerTexCoord, float2 filterDir)Description
Perform a 2x Lanczos downsample along a specific direction (either horizontal or vertical).
Called by downsample-2x and tonemap-and-downsample.
Parameters
sourceTexture, samp-
Type:
DECLARE_TEXTURE2D_AND_SAMPLER_PARAMA texture and sampler pair used to sample the texture to be filtered.
centerTexCoord-
Type:
float2The texture coordinate for the center of the filter.
filterDir-
Type:
float2The direction of the filter:
(1, 0)for a horizontal downsample and(0, 1)for a vertical downsample.
Return Value
Type: float4The result of the 2x downsample.