Questions tagged [interpolation]
64 questions
16
votes
1 answer
How are mipmap levels computed in Metal?
My question is specifically in regards to Metal, since I don't know if the answer would change for another API.
What I believe I understand so far is this:
A mipmapped texture has precomputed "levels of detail", where lower levels of detail are…
lcmylin
- 413
- 3
- 6
12
votes
1 answer
Is a cubic Lagrange interpolation tensor product the same as bicubic interpolation?
I just implemented some interpolated texture sampling by sampling the 4x4 nearest pixels then doing Lagrange interpolation across the x axis to get four values to use Lagrange interpolation on across the y axis.
Is this the same as bicubic…
Alan Wolfe
- 7,711
- 3
- 29
- 72
9
votes
3 answers
What is bilateral upsampling?
I've worked with various interpolation algorithms including linear, cubic (and bilinear and bicubic), other bezier (and nurbs, etc) based interpolations, lagrange interpolation and some others, but I haven't been able to find any basic info that…
Alan Wolfe
- 7,711
- 3
- 29
- 72
6
votes
2 answers
How do I use barycentric coordinates to interpolate vertex normal?
Given a triangle and a point inside the triangle in Cartesian coordinate system, I compute the Barycentric coordinate of the point like this:
double v2_1[3], v2_3[3], v2_t[3];
double bary[3];
vtkMath::Subtract(p1, p2, v2_1);
vtkMath::Subtract(p3,…
Bla...
- 451
- 4
- 12
6
votes
1 answer
Image rescaling algorithm
Suppose I have to use bilinear interpolation to rescale image. I more or less understand how enlargement works in case of integer scale factor.
But what to do with non-integer scale and especially when you need to downsample an image?
justanothercoder
- 163
- 4
6
votes
1 answer
Perspective correct interpolation of normal values
I'm currently writing a software rasterizer and I'm at the point where I can draw arbitrary triangles with vertex colors and perspective correct texture mapping. I do point and directional lighting by linearly interpolating the vertex normals and it…
Leon2806
- 95
- 5
5
votes
1 answer
The mathematics of two dimensional interpolation on a quad
I am trying to wrap my head around how exactly the GPU interpolates texture coords on a quad. I realize to the GPU a quad is two triangles but I find thinking in terms of the whole quad to be easiest.
If we define texture space as the texture…
J.Doe
- 1,445
- 11
- 22
5
votes
1 answer
Normal Interpolation for Phong shading
As the title says I have been trying to understand the normal interpolation for the Phong shading/lighting model. I am unsure of the equation to calculate the normal but I have come across this equation:
N=Na*α+Nb(1−α)
Where N is the interpolated…
Will D
- 105
- 2
- 5
5
votes
1 answer
How to rasterize a line when the background color is not always white?
I've to rasterize a line taking into account not only the background color of the screen, which is white, but also the color of other objects in the scene. In my case, I've just another object, a sphere, which is actually visualized using a ray…
user4718
5
votes
1 answer
Is there a way to interpolate color across the line with only integer calculation ?`
Here is my function that does interpolation
static public PixelData InterpolateColour(Point start, Point end ,float curLength, float totalLength){
float endPercent = curLength / totalLength; // Calculates the percent of colour at…
user3437
5
votes
0 answers
Which interpolation algorithm does MS Paint on Windows 7 use for image rescaling?
I was about to scale this image down to 64x64 pixels:
The result I got on MS Paint on Windows 7 was surprisingly good (i.e. crisp edges):
, whereas scaling it with GIMP resulted in for cubic and for Lanczos3 interpolation, both of which look…
dialer
- 151
- 2
5
votes
1 answer
Interpolating vectors on a grid
If you have values on a grid and you want to find the value of a point within one of the cells, you can use techniques like bilinear or bicubic interpolation to get the data at that point.
What technique(s) would be used if the data on the grid was…
Alan Wolfe
- 7,711
- 3
- 29
- 72
4
votes
1 answer
Screen coordinates, barycentric coordinates and global coordinateas
To continue with this my other question, here's the problem. So, I've a slide, which I'm trying to understand.
Here are my questions.
What are the barycentric coordinates of? From my previous question, $(x_1, y_1)$ and $(x_2, y_2)$ are also…
user4718
4
votes
1 answer
How can you interpolate over an array of say 5 colors?
I have an array of color values. I have an interpolating parameter, t, which varies from 0 to 1.
I can't for the life of me figure out how to smoothly interpolate between these color values based on t, such that I get a smooth blended color for any…
lokstok
- 43
- 2
4
votes
2 answers
Linear interpolation on Plane (Marching Cubes)
Let's assume I have the following cube.
Let's assume the isovalue = 0. I would like to draw the resulting triangles of the isosurface.
I know that first I define which values are inside or outside comparing them to the given isovalue and after that…
john john
- 423
- 1
- 3
- 9