22 votes
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 ...
user avatar
  • 23.6k
9 votes
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 ...
user avatar
  • 1,790
8 votes

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 ...
user avatar
8 votes
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 ...
user avatar
  • 7,341
6 votes
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 ...
user avatar
  • 811
6 votes

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}$,...
user avatar
  • 241
5 votes
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 ...
user avatar
  • 8,169
5 votes
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 ...
user avatar
  • 1,323
5 votes
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 ...
user avatar
  • 7,341
5 votes
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 ...
user avatar
  • 5,882
4 votes

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 ...
user avatar
  • 8,169
3 votes
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 ...
user avatar
  • 23.6k
3 votes
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 ...
user avatar
  • 23.6k
3 votes
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 ...
user avatar
  • 967
3 votes
Accepted

Normal Interpolation for Phong shading

Your first version was correct, except that alpha and 1-alpha should be swapped (the result should be ...
user avatar
  • 23.6k
3 votes
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 ...
user avatar
  • 1,750
3 votes

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-...
user avatar
3 votes
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 $$ ...
user avatar
  • 23.6k
3 votes

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 ...
user avatar
2 votes
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 ...
user avatar
2 votes

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 ...
user avatar
  • 2,302
2 votes

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 ...
user avatar
  • 3,556
2 votes
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 ...
user avatar
  • 23.6k
2 votes

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 ...
user avatar
  • 1,750
2 votes

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 (...
user avatar
  • 431
2 votes

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 ...
user avatar
  • 23.6k
2 votes

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 ...
user avatar
  • 6,450
2 votes

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 "...
user avatar
  • 41
2 votes

Texturing an "infinite" plane

$$ \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{\...
user avatar
2 votes

Interpolation in Graphics Pipeline

The rasterizer determines, which pixel is rendered depending on vertex positions that come out of the vertex shader. For each rasterized pixel, the rasterizer knows where it lies inside the triangle ...
user avatar
  • 1,150

Only top scored, non community-wiki answers of a minimum length are eligible