# Tag Info

Accepted

### How are mipmap levels computed in Metal?

Mip selection is pretty well standardized across devices today—with the exception of some of the nitty-gritty details of anisotropic filtering, which is still up to the individual GPU manufacturers to ...
• 23.6k
Accepted

### What is bilateral upsampling?

It seems like you're asking two things. I can't really speak technically about JBU, but I can give an overview of the necessary concepts and bilateral filtering generally. You'll probably need to ...
• 1,790

### The mathematics of two dimensional interpolation on a quad

(It actually is easier to think (and compute) about this with triangles, but for the sake of the answer, let's first stick to your quad example.) For this you just have to define the point you're ...
• 1,615
Accepted

### Is a cubic Lagrange interpolation tensor product the same as bicubic interpolation?

It turns out that no, while you can use bicubic Lagrange interpolation for bicubic texture sampling, it isn't the highest quality option, and probably not actually likely to be used. Cubic hermite ...
• 7,341
Accepted

### Determining Rational Quadratic Bezier Curve Weights for Circle

Check out the section on Circular Arcs and Circles, from Ching-Kuang Shene's excellent computational geometry course notes: [G]iven three control points P0, P1 and P2 such that P0P1 = P1P2 holds, if ...
• 811

### What causes blobby edges with alpha testing?

Let's consider the simplest case, where our texture is 2x2, with alpha values $a_{0,0}, a_{1,0}, a_{0,1}, a_{1,1}$. With bilinear filtering, the alpha at $uv$ coordinate $(x,y)$ is lerp(lerp($a_{0,0}$,...
• 241
Accepted

### How do I use barycentric coordinates to interpolate vertex normal?

Thats the way your defining the vectors. See your defining vectors $V_1$ and $V_2$ as pointing outwards from the point $P_2$. Now then $denom$ is the square of the area of the parallelogram of formed ...
• 8,169
Accepted

### Image rescaling algorithm

Explanation With a non-linear scale, you apply different weights for each pixel (or whatever unit you are using). You can use Euclidean distance towards the closest pixels in both directions to ...
• 1,323
Accepted

### Interpolating vectors on a grid

I did some research and found the answer I was looking for. The three most common ways to interpolate vectors are: Slerp - short for "spherical interpolation", this is the most correct way, but is ...
• 7,341
Accepted

### Is there a way to interpolate color across the line with only integer calculation ?`

Yes, it is possible to use only integer calculations. I will describe how, but bear in mind that the difference in speed between integer arithmetic and floating point arithmetic is not as great as it ...
• 5,882

### How to use Monotone cubic interpolation in 3D?

Ok, monotonic interpolation depends on what you are monotonic about. For a simple 1D function interpolation monotonicity is easy to define. But for a 2D and 3D dataset its not so self evident what the ...
• 8,169
Accepted

### Creating a gently moving 2D fog effect

Animated noise can be created by using time as an extra dimension. So instead of 2D noise, you'd use 3D noise with time as the z-axis position, like ...
• 23.6k
Accepted

### Perlin Noise with Smooth function vs Lerp

It looks like the way you're using smoothstep isn't quite right. With lerp, the first two parameters are the endpoints of the output range, and the third is a 0–1 value specifying how far to ...
• 23.6k
Accepted

### How to obtain generalized barycentric coordinates for n-sided polygon?

Quadrilateral basis functions can be calculated using an outer product of the basis of two linear functions (1-r, r) and (1-s, s). The same thing does not apply for arbitrary $n$-sided domains. For ...
• 967
Accepted

### Normal Interpolation for Phong shading

Your first version was correct, except that alpha and 1-alpha should be swapped (the result should be ...
• 23.6k
Accepted

### How can you interpolate over an array of say 5 colors?

Say you have colors $[c_1, c_2, c_3, c_4, c_5]$ And $t$ values at which each color should be purely displayed. $[t_1, t_2, t_3, t_4, t_5]$ Now your problem is given $t$ which color do I have to ...
• 1,750

### What is bilateral upsampling?

This probably does not explore the full depth of the term, but the first thing that comes to my mind when I hear "bilateral upsampling" is depth-aware blending of low-resolution images onto high-...
• 872
Accepted

### Interpolate vertex attributes with $z$ AFTER homogeneous divide

The $Z$ of NDC space is related to $1/Z_\text{view}$ but not the same. With a typical projection matrix, they're related by an affine remapping, $$Z_\text{NDC} = a \, \frac{1}{Z_\text{view}} + b$$ ...
• 23.6k

### Smooth triangular mesh interpolation

You may be able to eliminate the triangular artifacts by using Natural Neighbor Interpolation. You can find a description of the technique and an associated description of the algorithm at An ...
• 131
Accepted

### Perspective correct interpolation of normal values

Perspective correct interpolation of normals works just as it does any color or coordinate or other linearly varying attribute. Each component of each varying vector is interpolated independently as ...

### Linear interpolation on Plane (Marching Cubes)

P1 and P2 in this case represent the actual coordinates of the vertices of the cube in your output mesh. These might be the same as the input coordinates of the function you're using, or they might ...
• 2,302

### Does the blending matrix change between calculating various curve segments in a uniform cubic B-splines approximation?

No, $B$ is constant for given type of cubic spline, e.g. B-spline, Bezier, Hermite or Catmull-Rom cubic splines have different $B$ matrix. To make B-spline continuous, you need to copy 3 control ...
• 3,556
Accepted

### Does the blending matrix change between calculating various curve segments in a uniform cubic B-splines approximation?

No, the $B$ matrix (basis coefficient matrix) does not change from one segment to the next. It is a property of the type of spline you're using, in this case cubic B-splines. If you used Bézier ...
• 23.6k

### Find closest point on surface interpolated by 2d matrix of points

This is only a rough idea, though I hope it may inspire better answers. The closest point on a surface is as far as I know always forms together with the red point a line that is orthogonal to the ...
• 1,750

### How do I use barycentric coordinates to interpolate vertex normal?

You can find which coefficient belongs to which vertex empirically by changing t to be one of the points on the triangle (...
• 431

### Screen coordinates, barycentric coordinates and global coordinateas

It sounds like you're rasterizing a line segment between two endpoints. The points on the line are obtained by linearly interpolating between the endpoints (whether in world space, screen space, or ...
• 23.6k

### Bilinear Interpolation

I think the formula at the top only makes sense if $n$ and $m$ are pixel indices, i.e. row and column numbers from 0 to $H - 1$ and 0 to $W - 1$. This way, for the four surrounding pixels, the weight ...
• 6,450

### Geometric interpretation of this bilinear interpolation equation?

If we look at the two terms with only x or only y they fully describe what happens when you go right or up from the starting point. The xy-terms does not come into play at all. When you want to go "...
• 41
 \def\mvec#1{\begin{pmatrix}#1\end{pmatrix}} \def\ivec#1{\left(\begin{smallmatrix}#1\end{smallmatrix}\right)} \def\mmat#1{\begin{bmatrix}#1\end{bmatrix}} \def\vec#1{\mathrm{\mathbf{#1}}} \def\mat#1{\...