Motivation
Perspective-correct interpolation answers a point question: which texture coordinate belongs to this screen sample? Filtering asks a region question: which part of the texture contributes to a whole pixel? A distant surface can put many texture cells inside one pixel even when its center coordinate is calculated perfectly. Sampling the right coordinate once therefore does not establish that the pixel average is right.
The earlier appearance note introduced mipmaps and explained why long, narrow footprints need special care. We now derive the missing scale calculation. First we differentiate the perspective interpolation quotient in screen coordinates. Then we explain exactly what its Jacobian predicts, give a bound on the finite-pixel error, and connect its two singular values with mipmap scale and anisotropy. The calculation also exposes two errors that can look plausible: measuring normalized coordinates without converting to texels, and using footprint area as the only measure of minification.
Work inside one nondegenerate projected triangle with known affine screen barycentric functions and positive clip denominators . Screen coordinates are measured in pixel spacings. Vertex texture coordinates specify an affine attribute model before projection. They are unwrapped coordinates: a periodic texture may later repeat, but no coordinate has been reduced modulo one during interpolation. This note specifies a mathematical filter-scale model; it does not assert a particular graphics API's shader-derivative or texture-selection rules.
Definitions
Definition 3.2.1
(The perspective texture map in texel units)
Let the base texture dimensions be texels, and put
These are affine functions of screen position . The continuous map into base-level texel coordinates is
A convention that translates texel centers by a fixed offset changes by a constant and leaves its derivative unchanged. Texture wrapping and boundary extension are separate operations applied to the resulting coordinate model.
Inside the closed triangle , since its weights are nonnegative and sum to one. A square pixel centered near an edge can extend outside that triangle. Whenever we discuss its whole footprint, we explicitly require the chosen square or disk to lie in the triangle, or declare that the same rational map is being extended to that neighborhood with positive denominator. For a partly covered pixel, the actual surface contribution is restricted to the covered region; an unrestricted square footprint is then a scale estimate, not an exact description of visibility.
Definition 3.2.2
(Local footprint and principal stretches)
At a point with , let be the Jacobian. A screen displacement has first-order texture displacement . Its largest and smallest singular values are : the square roots of the two eigenvalues of . The operator norm is . Both stretches have units of base texels per screen-pixel spacing.
A unit pixel square has displacements in . Its linearized image is a parallelogram, possibly a segment or a point. A screen disk of radius instead maps to an ellipse with semiaxes , including the degenerate cases. The disk of radius is inscribed in the square, and the disk of radius contains it. These are useful comparisons, but they do not turn the exact square footprint into an ellipse.
Theorem / proposition
Theorem 3.2.3
(Exact quotient derivative and finite-displacement identity)
Write , let be its constant derivative, and let be a column vector. Wherever ,
At , every displacement whose endpoint has positive denominator satisfies the exact identity
If and , the denominator stays positive throughout that disk (using the rational extension where it leaves the triangle), and
Thus the actual disk footprint lies within this distance of its pointwise linearized image. In fact their Hausdorff distance is at most the same bound, since both images are parametrized by the same disk.
The error is measured in base texels. A small controls relative denominator variation, while sets the displacement scale. A statement that the Jacobian is “local” is not an error estimate until a neighborhood and some control such as these are supplied. The sufficient condition can fail even when is positive on a particular smaller or nonsymmetric region; failure of this bound is not proof that the map itself is invalid.
Theorem 3.2.4
(Principal stretches, area, and a two-column scale bound)
The linearized image of a screen disk has the principal semiaxes stated above, and the area of the linearized unit square is . If are the two columns of and
then
For , the unbounded logarithmic scales and therefore differ by a number in . Area alone places no upper bound on .
Proof sketch or proof idea
Proof
(Quotient rule and the exact finite displacement)
Apply the scalar quotient rule to each component: , and similarly for . Stack the rows and use to obtain the first formula. This calculation uses derivatives in screen-pixel coordinates; differentiating with respect to an unrelated object parameter would produce a different matrix.
For the finite identity, affine functions satisfy and . Subtract over a common denominator:
Subtracting leaves . Cauchy–Schwarz gives and . Finally gives the error bound. The same pairing of each exact image point with the linearized point having parameter bounds the distance in either direction between the two image sets. If , the map is affine and the remainder is identically zero.
Proof X-ray
What the derivative leaves out
For a perspective map, the finite displacement is exactly a displacement-dependent scalar multiple of . The missing factor is , not an unspecified extra rotation; it can vary with both the length and direction of the displacement. The error proof controls that one factor by keeping the denominator away from zero. It therefore separates an exact quotient derivative, a justified local approximation, and an approximate filtering policy. None of these steps supplies an ideal antialiasing filter by itself.
Proof
(Singular values, area and the column bound)
For the second theorem, orthogonally diagonalize the positive semidefinite matrix . Equivalently, singular-value decomposition applies an orthogonal transformation (a rotation or reflection) to the screen disk, scales its two orthogonal directions by , and applies another orthogonal transformation. This proves the ellipse description. The usual determinant area formula gives the square's area, and gives , also when the determinant vanishes.
Because each coordinate unit vector has norm one, and are at most ; hence . Conversely, for a unit vector ,
Take the maximum over that unit circle. The matrices have determinant one and largest singular value for every , proving the area limitation.
Worked examples
Worked example 3.2.5
(Tracing a perspective triangle all the way to a footprint)
Take screen vertices , clip denominators , vertex texture coordinates , and . The barycentric functions are , so
At , , , , and . Therefore
The unit diagonal directions and have stretches and . Both are positive eigenvalues of this symmetric matrix, so they are its singular values. The maximum column norm is only : checking horizontal and vertical changes alone misses the larger diagonal stretch.
Now use the whole pixel square centered at . It stays inside the triangle. At its upper-right corner, , the exact coordinate is . Its displacement from is , whereas . The exact displacement is times the linearized one, leaving remainder .
The containing disk has and . The bound is texels, exactly the norm of this corner's remainder. This example demonstrates both the usefulness and the finite size of the approximation error; an exact center derivative does not make the pixel map affine.
Worked example 3.2.6
(Normalized coordinates conceal the texture's dimensions)
Concept lensAlgebraic
The footprint as a metric on the screen
Squared texel length of a screen displacement is with , so the footprint is described by the symmetric matrix , whose eigenvalues are . In the example, has eigenvalues and , giving and .
Suppose the normalized-coordinate derivative is and the base texture is . Multiply on the left by to obtain in texel units. The principal stretches are and , not two equal tiny numbers. Their ratio is four. At an isotropically halved level one, they become and in that level's texel units. Measuring normalized coordinates without would miss both the minification in one direction and the anisotropy.
From a stretch to a declared mipmap policy
For this discussion, assume a finite idealized pyramid with levels , each level halving both coordinate scales exactly. Thus level measures the base texture position in units larger by , and its Jacobian is . This assumption is exact for a power-of-two texture pyramid only while both dimensions still halve. In a rectangular pyramid, once the shorter dimension reaches one texel it stops halving; subsequent levels require their actual horizontal and vertical scale factors, as do arbitrary rounded dimensions.
One conservative local linear objective is to make the largest stretch at most one level-texel per screen-pixel spacing. The smallest nonnegative integer level meeting it, when that level exists, is
Use level zero when . If , selecting the coarsest stored level is a clamp, not satisfaction of the objective. A continuous scale parameter can instead guide a blend of adjacent levels. Blending smoothly between two stored filtered images is an approximation; it does not construct the exact desired footprint integral. The word “conservative” here describes this derivative-scale objective, not a proof of alias-free rendering, a bound for every texture spectrum, or full finite-pixel containment.
When , the anisotropy ratio is . At scale , the short-axis stretch is about . An isotropic prefilter broad enough for the long direction may then smooth much more than needed across the short direction. Directional filtering tries to respect both directions. If , the linearized footprint has rank one and no finite ratio; if both are zero, it is a point. Do not hide either case behind division by an invented small constant.
Worked example 3.2.7
(Choosing a level without claiming an exact filter)
In the perspective example , so . Assuming level one exists, the integer policy selects it; its principal stretches are and . A column-norm policy instead gives before clamping, about level smaller. The theorem bounds such a continuous-scale discrepancy by one half level, but taking ceilings can change an integer decision by one level. Neither calculation accounts by itself for the corner remainder just measured, a texture's color-space decoding, the chosen reconstruction kernel, or a discontinuity across an unrelated triangle.
Common mistakes
Counterexample mode
One texel of area can still contain severe directional minification
Consider the affine map . Its pixel area scale is one, yet its principal stretches are and . Let a continuous texture have intensity . The image intensity is . At every integer pixel center it is one, whereas its uniform average over each unit pixel square is one half, because the cosine integrates to zero over a full period. Half-integer centers instead give zero, which also misses that average. An area-only rule calling this “one texel per pixel” misses the long-direction oscillation completely. The texture itself has a period of sixteen base texels; the failure arises under projection and point sampling. A scale choice must examine directional stretch, and a claimed antialiasing result must also specify a filter.
The Jacobian predicts local coordinate change, not how much color variation the texture actually contains. A constant texture needs no averaging to remove oscillation. Conversely, a high-frequency texture and a rapidly changing denominator can expose shortcomings of a small local filter. Geometric derivatives, spectral assumptions, prefilter construction and visibility must be kept in the same reasoning chain.
Common mistake
(Differentiating the wrapped coordinate)
Do not differentiate the wrapped sawtooth coordinate at a periodic seam. For an intended path from to , the unwrapped difference is . Replacing the endpoint by before interpolation invents a difference of . A repeating sampler can evaluate coordinates beyond one without changing this original path. Choosing an unwrap requires the intended surface parameterization; the two stored residues alone do not establish which path was intended.
Common mistake
(Finite differences between unrelated fragments)
An analytic derivative of one primitive also differs from a finite difference between unrelated fragments. If neighboring image samples belong to different triangles, materials or branches, subtracting their coordinates need not approximate the derivative proved here. Establishing the behavior of a particular derivative instruction requires its API contract and execution conditions. No such native execution is claimed by these equations.
Quick check
(If all are equal, what happens to the finite error?)
Solution · Answer
Since , is constant, so , and is affine. The linear footprint is exact wherever that affine model is used. This still does not make one point sample equal to the integral of an arbitrary texture over the footprint.
Summary
Perspective texture coordinates are quotients of affine screen functions. Their derivative gives a texel-unit Jacobian, while an exact displacement identity quantifies when its finite-pixel approximation is accurate. Singular values distinguish long and short directions; their product measures area and cannot replace the largest stretch. A mipmap policy based on that stretch is a declared approximation whose limits include denominator variation, filtering, finite level storage and visibility.
Exercises
Quick check
(Let , , , and . Compute and the exact displacement for . Compare it with and verify the scalar factor in the displacement identity.)
Solution · Answer
At the center , , and . Thus
The endpoint is , where . The exact displacement is , compared with . Multiplication by gives the exact displacement. The remainder is ; the nonzero vertical change comes from dividing the unchanged numerator by a changed denominator.
Quick check
(For , find the semiaxes of the image of a disk of radius and the area of the linearized unit-square footprint. Under the stated pyramid policy with , which integer level is selected and what are the two resulting stretches?)
Solution · Answer
The principal stretches are three and one, so the disk semiaxes are and . The square area is . The integer policy gives , and the stretches there are and . The ellipse and parallelogram describe different screen regions, so their areas should not be equated.
Quick check
(For , compute . Show that the factor in the column bound and the half-level logarithmic discrepancy are attained. Is the footprint an ordinary ellipse with positive area?)
Solution · Answer
Both columns have norm one, hence . The matrix has eigenvalues two and zero; therefore and . The unbounded logarithmic scales are and zero. A disk maps to a segment and the square area is zero. The largest stretch remains positive even though the area vanishes.
Quick check
(A rational map has , , , and a disk radius . Give a guaranteed lower bound for the denominator and an upper bound for the linearization error in base texels.)
Solution · Answer
Since , . Every denominator in the disk is at least . The error bound is
base texel. This is a uniform bound on that disk, not an assertion that every point has error one third.
Quick check
(An intended unwrapped coordinate along is , with constant denominator and width . Compare its texel derivative with that obtained by joining the wrapped endpoint values . Why can wrapping during sampling be valid while this endpoint replacement is invalid for the declared path?)
Solution · Answer
The declared derivative is texels per pixel spacing, whereas the replaced-endpoint derivative is . Its magnitude is forty-nine times as large and its direction is reversed. A periodic texture can return the same value at coordinates differing by an integer; that equality concerns texture evaluation, not the surface path between those coordinates. The replacement interpolates a different path, so it changes the footprint model.
Quick check
(Suppose . Find the anisotropy ratio and the integer level needed for the local stretch objective. Give the stretches there. If only levels zero through two are stored, what objective remains unmet at the clamped level?)
Solution · Answer
The anisotropy ratio is . Level three gives stretches one and and meets the declared local maximum-stretch objective. With , clamping gives stretches two and ; the maximum still exceeds one. More stored levels could meet that scalar objective, but isotropic smoothing would still address the two directions very differently, and no exact pixel-integral claim follows.