Texture Sampling #2: Bilinear & Bicubic Samples

preview_player
Показать описание
Following on from Part 1, I look at two common sampling methods that aim to reduce artefacts, bilinear and bicubic point sampling. The former linearly interpolates between neighbouring pixels, and the latter uses even further pixels to bias cubic splines to give a smoother contour between pixels.

Source: Released at end of series

Рекомендации по теме
Комментарии
Автор

Very interesting. If I'd had a teacher like you back in my highschool days, I'd surely would have loved maths much more. Nice video!

braveitor
Автор

Hello from Brazil! I love your channel and I'm glad there are still people who make smart content on YouTube.

lucasmuffato
Автор

You're a godsend. I'm writing my computer graphics exam in two days and texture sampling is the only topic I couldn't fully grasp

Garetk
Автор

And then there is another complication: RGB values are not linear themselves (gamma-corrected), with 128 giving almost 1/4 brightness compared to 255, as this was necessary for CRT monitors but also allowed to get good range with just 8 bits. Linear representation would require 10 to 12 bits and didn't improve image as human eye works logarithmically, it sure sees difference between 1 and 2 but can't spot difference between 999 and 1000.

So for correct sampling it is actually better to convert all pixel values into linear representation, sample pixel and return to gamma-corrected value. See MinutePhysics: computer color is broken.
Most visible effect of simplified methods is different brightness of textures depending on scale. Like, human averages small checkerboard correctly but when computer does it converting neighboring 0 and 255 into uniform 127, it gets 1/4 brightness instead of 1/2!

allmycircuits
Автор

I am currently writing real time software for car engine managment and just had to implement this too !

laser-sj
Автор

Never thought about bicubic sampling being a valid use of matrices until you laid out the math for it.

davidmcgill
Автор

Brilliant, I learn so much from this thank you

SassyToll
Автор

Very interesting and educational topic. Thanks for making these!

pholyn
Автор

I guess you could use 3 bicubic interpolation calculations for the following rows each time to increase performance? You’d have to do an entire columns worth of interpolated values at a time though. Starts to hurt your brain trying to describe this stuff, well done for relaying it so well David! Definitely one of your strengths!

wesleythomas
Автор

very nice video as always! Used bilinear sample in lightmaps for my 3D engine, that way I don't need too much resolution and the lack of resolution is less noticeable.

joaovitormeyer
Автор

Your videos are of great value to me. Thank you

Turjak_art
Автор

This is too interesting.

If you're able/willing to, please also cover bicublin (bicubic for luma, bilinear for chroma), and sinc/lanczos sampling.

Najvalsa
Автор

I forgot to vote last video! I'm a fan of these shorter videos more frequently.

dombthekid
Автор

This is very interesting and also very frightening as it reveals just how much I don't know. 😂

quicktastic
Автор

I like the shorter format! Specially if it makes it easier for you to put the videos out ;)

teucay
Автор

shorted videos indeed are OK, easier to comprehend the data received )))

Tiaronus
Автор

How about creating new interpolation that "interpolates" between point sampling if slope is big and bicubic if slope is small to preserve hard edges on the checkerboard or around the tree branches while remaining soft transitions on surfaces with smooth slopes? Maybe it would be possible to dynamically change "sharpness" of cubic interpolation curve?

Looki
Автор

If I were to build a rasterizer from scratch for a set of vectors like filled bezier paths such as in a font glyph or a simple vector drawing is a good method to draw it at a higher resolution (I.e. 2x or 4x) and then to scale down with bilinear or bicubic sampling, or is there a better method? Also, is that how "2x" and "4x" anti-aliasing is achieved?

johnernest
Автор

These interpolation methods ensure that the interpolated curve goes through the sample points exactly. But usually the low resolution texture to be interpolated is acquired by down-sampling a (theoretical) higher resolution image through mixing pixels together.
So under this assumption in order to more effectively "undo" this down-sampling, wouldn't it make more sense for the interpolation to preserve area under the curve for each sample region instead?

CDBE
Автор

These days i m busy with Bjarn Books, and Metaprogramming. I’m working on something abstract like mathematics field named algebraic geometry; so as in C++ there too match Libraries for Graphics; so why we don’t writing a Classes and functions for graphics object that can be valid for every Libs.
I ‘ m steel use Olc Console, your technic very valuable.
_thanks J_

__hannibaal__