Hacker News new | past | comments | ask | show | jobs | submit login

Interesting. A weighed average between at least two values in an array? Makes sense in the context of computer graphics. Thanks for the correction.



I don't typically think of it as indexing an array, but it's conceptually similar in some circumstances I suppose. The hardware still eventually has to read values from integer-based addresses, though. As to the details:

Sampling modes customize how the value calculation is done. Some will simply round the index to the nearest integer texel, resulting in only one value being accessed (cheap.)

Others will interpolate via weighted average as you're thinking, in the 1D case. Then there's the 2D and 3D cases... plus mipmaps... plus anti-aliasing patterns... at which point you could easily have 16+ samples bearing little resemblance to "indexing an array", especially as one can apply all these interpolation techniques to generic functions such as perlin noise which aren't array based.


And each of those sampling methods is exactly a function

    Double -> Int
Which is also exactly why having an int type is important. It otherwise becomes much harder to talk about the meaning of those functions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: