07-19-2018, 03:58 PM
This sample function in the wiki:
Is the simplified one, it only works if the independent variable t ranges from [0,1]. What if your t goes in the range [3, 5] for example?
But you figured out well the meaning of the line you talk about: returns an index in the interval [7, 0] from the current scanline value in the range [170, vres], that is the lower portion of the screen where the palette lightening happens. Raster effects in action
Code:
float lerp(float v0, float v1, float t) {
return v0 + t * (v1 - v0);
}
Is the simplified one, it only works if the independent variable t ranges from [0,1]. What if your t goes in the range [3, 5] for example?
But you figured out well the meaning of the line you talk about: returns an index in the interval [7, 0] from the current scanline value in the range [170, vres], that is the lower portion of the screen where the palette lightening happens. Raster effects in action
