Table of Contents
Fetching ...

A Texture Lookup Approach to Bézier Curve Evaluation on the GPU

Muhammad Anas, Alan Wolfe

Abstract

We present a texture-based technique for evaluating Bézier curves on the GPU that leverages fixed-function linear texture interpolation hardware. By offloading curve evaluation to the texture interpolator, this approach can improve performance in compute-bound GPU workloads. The method can also be used naturally for Bézier surfaces and volumes and extends to advanced curve types such as B-splines, NURBS, and both integral and rational polynomials. We show how Seiler interpolation fits into this framework to improve efficiency. We also compare performance and accuracy against curves evaluated as polynomials in shader code.

A Texture Lookup Approach to Bézier Curve Evaluation on the GPU

Abstract

We present a texture-based technique for evaluating Bézier curves on the GPU that leverages fixed-function linear texture interpolation hardware. By offloading curve evaluation to the texture interpolator, this approach can improve performance in compute-bound GPU workloads. The method can also be used naturally for Bézier surfaces and volumes and extends to advanced curve types such as B-splines, NURBS, and both integral and rational polynomials. We show how Seiler interpolation fits into this framework to improve efficiency. We also compare performance and accuracy against curves evaluated as polynomials in shader code.
Paper Structure (10 sections, 17 equations, 3 figures, 3 tables)

This paper contains 10 sections, 17 equations, 3 figures, 3 tables.

Figures (3)

  • Figure 1: The de Casteljau algorithm for a quadratic Bezier curve with control points A, B and C (left). The equivalent bilinear interpolation setup (right).
  • Figure 2: Three quadratic Bezier curves with C0 continuity stored in a 4x2 texture, instead of a 6x2 texture. The orange line shows how to sample the texture as t varies in $[0,3]$. The average of the green pixels opposite the orange lines define the middle control point. For $N$ curves, there will always be $N$ constraints with $N+1$ free variables to satisfy them.
  • Figure 3: Using the texture interpolator to evaluate Bézier curves suffers from quantization errors due to fixed point quantization of the $(u,v)$ coordinates. Here a cubic curve is shown evaluated using the de Casteljau texture method which samples a 2x2x2 volume texture with a single trilinear texture read. A hybrid mode is shown which evaluates two quadratic curves with the texture interpolator (two bilinear reads) and then does the final lerp in the shader at full 32 bit floating point precision to reduce the error. Lastly the Seiler method is shown which takes a single bilinear sample of a 2x2 texture. In all images, the polynomial ground truth is shown in white. Where the curve being evaluated is less than the ground truth, the curve is shown in red, and where it is greater than the ground truth, it is shown in green. The full sized image shows the de Casteljau method compared to the ground truth. Seiler is most affected by quantization error, but uses the fewest texels.