Background
- Gaussian blur optimizes large-radius blurring through downsampling -> small-kernel blur -> upsampling.
- After downsampling with a Box2x2 kernel, high-frequency image signals flicker temporally during motion.

Comparison
CrossBox still performs only four texture samples in the shader, but each tap falls between four texels in the previous level. Expanding GPU bilinear interpolation onto discrete texels gives the following effective single-pass kernel:
All subsequent CrossBox plots use this kernel, which already includes the linear sampler footprint.
Problem Definition
Let denote the complete "downsample -> blur -> upsample" operator. Let be the image's displacement from its initial position at time , and define the translation operator in original-image coordinates as
Frame is then . The requirement that "no flickering occurs during translation" can be stated as
The left side means "translate the original image, then run the full pipeline"; the right side means "run the full pipeline, then translate the result."
Analysis
Consider the blur pipeline first. It involves two different coordinate systems: denotes original-image coordinates, and denotes discrete coordinates in the low-resolution image:
The symbols above represent:
- is the downsampling convolution with kernel before decimation. Throughout the rest of this article, refers to the effective weights that texture sampling actually applies to discrete pixels in the previous level: if a sample position falls between pixels, GPU linear interpolation is first expanded onto the neighboring pixels, and the weights of all samples are then summed;
- is impulse sampling at intervals of , with the result still expressed in original-image coordinates. It includes the fixed phase of the actual sampling grid, which will be written explicitly below;
- compacts the sparse impulse weights into a low-resolution image;
- is Gaussian blur on the low-resolution image;
- places the low-resolution pixels back into original-image coordinates, inserting empty values between samples;
- is the upsampling convolution with reconstruction kernel .
The signals above are shown below.

Original image

Downsampling convolution

Impulse sampling

Downsampling rearrangement

Low-resolution blur

Upsampling rearrangement

Reconstruction convolution
For convenience, the derivations below omit the independent variable for signals in original-image coordinates, writing them simply as . Only low-resolution images explicitly show their discrete coordinates: and .
Decomposing
Returning to our proposition:
We need to fully expand , then try to move the translation operator from right to left through each processing step. Following the pipeline above, is
Therefore, sending the translated image through this chain gives
Our goal is to determine whether the rightmost can move all the way to the left, ultimately yielding . We can now check whether can pass through each operator in turn. Here, uses the actual effective kernel defined above. Since GPU linear interpolation is already included in , remains a convolution operator and commutes exactly with translation in original-image coordinates:
Impulse sampling and the downsampling rearrangement convert the signal from original-image coordinates to low-resolution coordinates, so these two operations must be examined together. After -fold downsampling, displacement in the original image should correspond to displacement in low-resolution coordinates. Below, denotes an ideal continuous translation in low-resolution coordinates.
The low-resolution convolution likewise commutes exactly with translation in its coordinate system:
Finally, and together return the signal to original-image coordinates. The required commutation relation is
The movement of the translation operator through the entire chain can therefore be summarized as
Set , , and aside for now and focus on the first question mark:
In other words, "downsample, then translate" and "translate, then downsample" must produce identical results.
Moving into the Frequency Domain
A 2D image simply repeats the same process in the horizontal and vertical directions, so for now we treat as a 1D signal and abbreviate displacement as . Hats will denote Fourier transforms throughout: .
The rest of the analysis relies on three frequency-domain properties:
- Translating signal by adds only a phase term to its spectrum:
- A comb function with spacing remains a comb function in the frequency domain, with spectral copies separated by . Actual GPU downsampling also has a fixed sampling phase: for a single 2x downsample, output pixel centers are located at in the previous level. After consecutive passes, , and the sampling positions in original-image coordinates are
For example, after three 2x downsampling passes, and the sampling grid is . We therefore use a comb function with phase:
Its Fourier transform is
- After -fold downsampling, the range that the low-resolution image can represent without aliasing in original-image frequency coordinates is the baseband .
Therefore, "translate first, then sample" produces the spectrum
For "sample first, then translate," every spectral copy should receive the same phase:
The fixed sampling phase appears in both paths, so it does not affect whether they are equal. The only difference remains the factor produced by the input displacement:
For the baseband spectrum, , this factor always equals .
When the displacement happens to be an integer multiple of , all additional phases equal :
For the equality to hold for any displacement , only the term can remain in the baseband. In other words, the signal after downsampling convolution must satisfy
is the Nyquist frequency for sampling interval . For a 2D image, the corresponding alias-free region is
Therefore, the condition for the downsampling stage to remain consistent under arbitrary continuous translations is
Since
the condition that actually needs to hold for this particular image is
If we want this conclusion to hold for any input image, we can only require the downsampling kernel itself to satisfy
In other words, the ideal downsampling kernel is an ideal low-pass filter. Although this cannot be realized in practice, it gives us a way to analyze error: minimizing energy beyond the Nyquist limit reduces the visual artifacts caused by aliasing.
The problem therefore becomes finding a sufficiently good low-pass filter (downsampling kernel) that attenuates energy beyond the Nyquist limit.
Examining the Nyquist Region in Spectrum Plots
The cyan square marks the Nyquist region for a total of downsampling:
The square contains the frequencies that the low-resolution image can represent uniquely. Any energy remaining outside the square folds back into it after decimation.

Original-image spectrum

Single-pass Box2x2:

Three-pass Box2x2:

Three-pass CrossBox:
Single-pass Box2x2 retains nearly all the original image's frequency energy near the square's edges. Three-pass Box2x2 substantially reduces energy outside the square, but regular side lobes remain visible. CrossBox's actual response also includes each pass's GPU bilinear footprint and an additional direction-dependent factor of . The area outside the square is therefore darker overall, but its passband also attenuates more than Box2x2.
These four plots directly illustrate the condition derived above:
The darker the area outside the square, the less energy can fold back into the baseband carrying displacement-dependent phase, and the weaker the flickering during motion.
Additional Issues
Bug in the Current Implementation
The current implementation performs only a single pass of GPU bilinear interpolation, providing almost no attenuation outside the Nyquist region. Aliasing becomes more severe at higher downsampling levels.


Are There Better Kernels?
Each row shows, from left to right:
- The effective spatial weights produced by composing three convolution passes;
- The frequency response of the effective kernel itself, ;
- The spectrum of the original image after convolution with the effective kernel, .
The effective spatial kernels are drawn at their actual support sizes. Taps in the fixed even-sized kernel fall at texel centers, expanding to after three passes. Taps in the fixed and odd-sized kernels fall at half-texel positions, so GPU bilinear interpolation first expands them to and , and their three-pass effective support sizes are and , respectively. The two procedural Lanczos kernels have support sizes of and . Warm colors indicate positive weights and blue indicates negative weights. Each spatial plot normalizes its colors by its own maximum absolute weight and is intended only to show weight shape and sign distribution. The cyan squares in the latter two columns still mark the Nyquist region for a total of downsampling, and all convolution results use the same logarithmic brightness range as above.
Every row shows the weights that the renderer actually applies to discrete texels in the previous level. For odd-sized fixed matrices, this includes the hardware linear sampler's footprint. The Lanczos rows use the discrete weights that the renderer actually generates for a scale factor of and half-pixel phase. Boundary addressing modes are excluded from this frequency analysis, which assumes an infinite, translation-invariant domain. The CrossBox row uses exactly the same single-pass effective kernel as the three-pass CrossBox discussed above.
Box2x2



Box3x3



CrossBox



Gaussian3x3



Gaussian5x5



Lanczos3



Lanczos5



These plots directly compare the effective behavior of seven presets in the same three-pass pipeline with a total of downsampling. The corrected Lanczos3/5 kernels exhibit the expected approximate brick-wall low-pass response: nearly flat inside the cyan square, a transition concentrated near its boundary, and mostly black outside it.
At the horizontal cutoff boundary , the three-pass magnitudes of Lanczos3 and Lanczos5 are approximately and , respectively. At , well inside the stopband, they fall to approximately and . Lanczos5 has a steeper transition and a cleaner stopband.
The criterion therefore remains the same: the darker the area outside the square, the less energy can fold back into the baseband after decimation.
Limitations of CrossBox
The kernel determines how much each frequency is attenuated, but what actually enters the decimation step is . Therefore, even with the same kernel, different source signals produce different degrees of aliasing because their frequency-energy distributions differ.
The three columns below use exactly the same FFT, logarithmic brightness range, and Nyquist square for downsampling. Each column shows the original image above its corresponding magnitude spectrum .









Coordinate-axis and grid signal
Diagonal-grid signal
Replacement UI screenshot
CrossBox's directionality does not mean "stronger attenuation in the horizontal and vertical directions." Along a frequency axis, for example , the additional factor is ; along the diagonal , it is . The latter falls faster near low frequencies and reaches zero earlier, at . Its attenuation is therefore generally stronger for diagonal frequencies and relatively weaker for components along the frequency axes. Actual flickering still depends on both this directional response and the input spectrum; we cannot conclude that CrossBox is more suitable merely because "UI imagery is dominated by horizontal and vertical edges."
Conclusion
- All four CrossBox shader taps in this implementation use bilinear sampling. Its actual single-pass discrete kernel is , and its three-pass effective support is .
- Compared with three-pass Box2x2, CrossBox trades additional passband attenuation for stronger stopband suppression. Its response is also directional: attenuation is stronger for diagonal frequencies and relatively weaker along the frequency axes.
- Lanczos provides the best frequency selectivity, but its kernels are larger. Whether it is worthwhile depends on the target radius, bandwidth, and texture-sampling instruction cost.