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 ...
10
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 ...
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 ...
7
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 ...
6
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 ...
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 ...
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}$,...
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 ...
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 ...
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 ...
4
votes
Accepted
Perspective correct interpolation z-buffer
Yes, that's correct. Perspective-correct interpolation works by (for some quantity $u$ to be interpolated) calculating $u/z$ and $1/z$ at each vertex, linearly interpolating those values in screen ...
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 ...
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 ...
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 ...
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 ...
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 ...
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-...
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
$$
...
3
votes
Accepted
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 ...
3
votes
Correct way to interpolate 1/z?
You are right.
In the examples you provided you only seem to render "pre-transformed" triangles which is why I think you were missing the point made in the article. Which depth testing is ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 (...
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 ...
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 "...
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 ...
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{\...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
interpolation × 66texture × 7
image-processing × 7
algorithm × 6
mathematics × 6
geometry × 6
c++ × 5
perspective × 5
rasterizer × 5
animation × 5
curve × 5
rendering × 4
transformations × 4
color × 4
sampling × 4
3d × 3
computational-geometry × 3
shading × 3
fragment-shader × 3
filtering × 3
raytracing × 2
shader × 2
glsl × 2
lighting × 2
mesh × 2